From 4f4a0715150623eccedbf7bf24cd9a008b2e8acc Mon Sep 17 00:00:00 2001 From: Ramesh Mane <101566080+rameshmane7218@users.noreply.github.com> Date: Wed, 27 Dec 2023 11:22:03 +0530 Subject: [PATCH] fix: percent field text select on focus issue --- packages/nc-gui/components/cell/Percent.vue | 1 + .../smartsheet/expanded-form/Comments.vue | 8 ++++---- packages/nc-gui/components/virtual-cell/Formula.vue | 13 +++++++++++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/packages/nc-gui/components/cell/Percent.vue b/packages/nc-gui/components/cell/Percent.vue index 1bb97f7fb1..1d6a4e6d1a 100644 --- a/packages/nc-gui/components/cell/Percent.vue +++ b/packages/nc-gui/components/cell/Percent.vue @@ -69,6 +69,7 @@ const onWrapperFocus = () => { nextTick(() => { wrapperRef.value?.querySelector('input')?.focus() + wrapperRef.value?.querySelector('input')?.select() }) } diff --git a/packages/nc-gui/components/smartsheet/expanded-form/Comments.vue b/packages/nc-gui/components/smartsheet/expanded-form/Comments.vue index 3e9aaeaede..f144978060 100644 --- a/packages/nc-gui/components/smartsheet/expanded-form/Comments.vue +++ b/packages/nc-gui/components/smartsheet/expanded-form/Comments.vue @@ -116,11 +116,11 @@ const saveComment = async () => { console.error(e) } finally { isSaving.value = false - - setTimeout(() => { - commentInputDomRef.value?.focus() - }, 400) } + + nextTick(() => { + commentInputDomRef.value?.focus() + }) } watch(commentsWrapperEl, () => { diff --git a/packages/nc-gui/components/virtual-cell/Formula.vue b/packages/nc-gui/components/virtual-cell/Formula.vue index f1356eceb2..a55e864d66 100644 --- a/packages/nc-gui/components/virtual-cell/Formula.vue +++ b/packages/nc-gui/components/virtual-cell/Formula.vue @@ -2,7 +2,17 @@ import { handleTZ } from 'nocodb-sdk' import type { ColumnType } from 'nocodb-sdk' import type { Ref } from 'vue' -import { CellValueInj, ColumnInj, IsExpandedFormOpenInj, computed, inject, renderValue, replaceUrlsWithLink, useBase, useGlobal } from '#imports' +import { + CellValueInj, + ColumnInj, + IsExpandedFormOpenInj, + computed, + inject, + renderValue, + replaceUrlsWithLink, + useBase, + useGlobal, +} from '#imports' // todo: column type doesn't have required property `error` - throws in typecheck const column = inject(ColumnInj) as Ref @@ -42,7 +52,6 @@ const { showEditNonEditableFieldWarning, showClearNonEditableFieldWarning, activ }" @dblclick="activateShowEditNonEditableFieldWarning" > -
{{ result }}