Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

fix(nc-gui): fix expanded form textarea korean inptut issue

Ramesh Mane97aba28ff888
diff --git a/packages/nc-gui/components/cell/Text/Editor.vue b/packages/nc-gui/components/cell/Text/Editor.vue
index 9430895d52..a4f25572c5 100644
--- a/packages/nc-gui/components/cell/Text/Editor.vue
+++ b/packages/nc-gui/components/cell/Text/Editor.vue
@@ -26,7 +26,7 @@ const inputRef = ref<HTMLInputElement | HTMLTextAreaElement>()
const focus: VNodeRef = (el) => {
if (!isExpandedFormOpen.value && !isEditColumn.value && !isForm.value) {
- inputRef.value = el as HTMLInputElement
+ inputRef.value = (el?.$el as HTMLTextAreaElement) || (el as HTMLInputElement)
inputRef.value?.focus()
}
}
@@ -68,13 +68,14 @@ function updateInput(e: any) {
@selectstart.capture.stop
@mousedown.stop
/>
- <a-textarea
+ <NcAutoSizeTextarea
v-else
:ref="focus"
- v-model:value="textareaValue"
- :auto-size="{ minRows: 1, maxRows: 6 }"
- class="!border-0 !border-none !outline-0 !ring-0 focus:!border-0 focus:!outline-0 focus:!ring-0 !px-2 !py-1 nc-scrollbar-thin"
- style="color: inherit; resize: auto !important; min-height: 32px !important; height: 32px !important"
+ v-model:model-value="textareaValue"
+ :hide-scrollbar="false"
+ :bordered="false"
+ class="!px-2 !py-1 !min-h-7 !max-h-7.5rem resize-none nc-scrollbar-thin"
+ style="color: inherit"
@keydown.enter.prevent
/>
</template>
diff --git a/packages/nc-gui/components/cell/Text/index.vue b/packages/nc-gui/components/cell/Text/index.vue
index 607981ead3..48618feb5d 100644
--- a/packages/nc-gui/components/cell/Text/index.vue
+++ b/packages/nc-gui/components/cell/Text/index.vue
@@ -52,13 +52,15 @@ const textareaValue = computed({
@selectstart.capture.stop
@mousedown.stop
/>
- <a-textarea
+
+ <NcAutoSizeTextarea
v-else
:ref="focus"
- v-model:value="textareaValue"
- :auto-size="{ minRows: 1, maxRows: 6 }"
- class="!border-0 !border-none !outline-0 !ring-0 focus:!border-0 focus:!outline-0 focus:!ring-0 !px-2 !py-1 nc-scrollbar-thin"
- style="color: inherit; resize: auto !important; min-height: 32px !important; height: 32px !important"
+ v-model:model-value="textareaValue"
+ :hide-scrollbar="false"
+ :bordered="false"
+ class="!px-2 !py-1 !min-h-7 !max-h-7.5rem resize-none nc-scrollbar-thin"
+ style="color: inherit"
@keydown.enter.prevent
/>
</template>
diff --git a/packages/nc-gui/components/nc/AutoSizeTextarea.vue b/packages/nc-gui/components/nc/AutoSizeTextarea.vue
index 20b74f7405..7dcb857194 100644
--- a/packages/nc-gui/components/nc/AutoSizeTextarea.vue
+++ b/packages/nc-gui/components/nc/AutoSizeTextarea.vue
@@ -7,7 +7,7 @@ import { useTextareaAutosize, type UseTextareaAutosizeOptions } from '@vueuse/co
*/
interface Props {
- modelValue?: string
+ modelValue?: string | number | null
disabled?: boolean
placeholder?: string
bordered?: boolean
@@ -28,7 +28,7 @@ const emit = defineEmits<{
* Make props reactive β€” keeps modelValue in sync
*/
const { modelValue } = toRefs(props)
-const value = ref(modelValue.value ?? '')
+const value = ref(modelValue.value?.toString() ?? '')
/**
* Auto-resize logic from @vueuse/core
@@ -80,7 +80,9 @@ defineExpose({
</template>
<style scoped lang="scss">
.nc-auto-size-textarea {
+ vertical-align: middle;
transition-property: border, box-shadow;
+
@apply !outline-none !ring-0 focus:(!outline-none !ring-0) duration-300;
&.nc-no-border {
diff --git a/packages/nc-gui/components/smartsheet/Form.vue b/packages/nc-gui/components/smartsheet/Form.vue
index 88b0bc2d0c..c87beb18ff 100644
--- a/packages/nc-gui/components/smartsheet/Form.vue
+++ b/packages/nc-gui/components/smartsheet/Form.vue
@@ -1298,11 +1298,7 @@ const { message: templatedMessage } = useTemplatedMessage(
:bordered="false"
:data-testid="NcForm.heading"
:data-title="NcForm.heading"
- @input="
- (value) => {
- updateView()
- }
- "
+ @input="updateView"
@focus="activeRow = NcForm.heading"
@blur="activeRow = ''"
/>