From 8072c40c061a0c298bc9f8789c1da88e19f7a71e Mon Sep 17 00:00:00 2001 From: Pranav C Date: Sun, 20 Nov 2022 17:07:07 +0530 Subject: [PATCH] feat(gui): focus first input in expanded form Signed-off-by: Pranav C --- packages/nc-gui/assets/style.scss | 10 +++------- packages/nc-gui/components/cell/Text.vue | 4 +++- packages/nc-gui/components/dlg/ViewCreate.vue | 2 +- packages/nc-gui/components/smartsheet/Grid.vue | 13 +++++++------ .../components/smartsheet/expanded-form/index.vue | 10 ++++++++-- .../components/smartsheet/toolbar/ShareView.vue | 9 +++------ packages/nc-gui/pages/index/index/index.vue | 6 +----- 7 files changed, 26 insertions(+), 28 deletions(-) diff --git a/packages/nc-gui/assets/style.scss b/packages/nc-gui/assets/style.scss index 7e3d0f5cd5..4e77210c00 100644 --- a/packages/nc-gui/assets/style.scss +++ b/packages/nc-gui/assets/style.scss @@ -214,17 +214,13 @@ a { @apply z-1 relative color-transition rounded-md px-4 py-2 text-white; &::after { - @apply ring-opacity-100 ring-[2px] ring-slate-300 rounded absolute top-0 left-0 right-0 bottom-0 transition-all duration-150 ease-in-out bg-primary bg-opacity-100; + @apply rounded absolute top-0 left-0 right-0 bottom-0 transition-all duration-150 ease-in-out bg-primary bg-opacity-100; content: ''; z-index: -1; } &:hover::after { - @apply transform scale-110 ring ring-accent; - } - - &:active::after { - @apply ring ring-accent; + @apply transform scale-110 ; } } @@ -261,7 +257,7 @@ a { } .ant-dropdown-menu-item, .ant-menu-item { - @apply !py-0 active:(ring ring-accent ring-opacity-100); + @apply !py-0; } .ant-dropdown-menu-title-content, diff --git a/packages/nc-gui/components/cell/Text.vue b/packages/nc-gui/components/cell/Text.vue index 465cfd73f9..05745ead2c 100644 --- a/packages/nc-gui/components/cell/Text.vue +++ b/packages/nc-gui/components/cell/Text.vue @@ -16,7 +16,9 @@ const readonly = inject(ReadonlyInj, ref(false)) const vModel = useVModel(props, 'modelValue', emits) -const focus: VNodeRef = (el) => (el as HTMLInputElement)?.focus() +const focus: VNodeRef = (el) => { + ;(el as HTMLInputElement)?.focus() +}