Skip to content

Commit

Permalink
🐛 fix: src/components/UI/TextareaAutosize.vue で max-height 変更時に autos…
Browse files Browse the repository at this point in the history
…ize.update が走るように
  • Loading branch information
reiroop committed Feb 2, 2025
1 parent 0a1d323 commit 5f296a0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
v-model="value"
:class="$style.textarea"
:style="textareaAutosizeStyle"
:max-height="textAreaAutoSizeMaxHeight"

Check warning on line 8 in src/components/Main/MainView/MessageInput/MessageInputTextArea.vue

View check run for this annotation

Codecov / codecov/patch

src/components/Main/MainView/MessageInput/MessageInputTextArea.vue#L7-L8

Added lines #L7 - L8 were not covered by tests
:readonly="isPosting"
placeholder="メッセージを入力"
rows="1"
Expand Down
4 changes: 2 additions & 2 deletions src/components/UI/TextareaAutosize.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import useTextModelSyncer from '/@/composables/useTextModelSyncer'
const props = defineProps<{
modelValue: string
maxHeight?: number
maxHeight?: string
readonly?: boolean
placeholder?: string
rows?: string
Expand Down Expand Up @@ -54,7 +54,7 @@ onMounted(() => {
autosize(textareaEle.value)
}
})
watch(toRef(props, 'modelValue'), async () => {
watch([toRef(props, 'modelValue'), toRef(props, 'maxHeight')], async () => {

Check warning on line 57 in src/components/UI/TextareaAutosize.vue

View check run for this annotation

Codecov / codecov/patch

src/components/UI/TextareaAutosize.vue#L57

Added line #L57 was not covered by tests
await nextTick()
if (textareaEle.value) {
autosize.update(textareaEle.value)
Expand Down

0 comments on commit 5f296a0

Please sign in to comment.