diff --git a/packages/nc-gui-v2/components/smartsheet-column/SelectOptions.vue b/packages/nc-gui-v2/components/smartsheet-column/SelectOptions.vue index 2b7d9db678..ce37a76836 100644 --- a/packages/nc-gui-v2/components/smartsheet-column/SelectOptions.vue +++ b/packages/nc-gui-v2/components/smartsheet-column/SelectOptions.vue @@ -8,16 +8,17 @@ import MdiArrowDownDropCircle from '~icons/mdi/arrow-down-drop-circle' import MdiClose from '~icons/mdi/close' import MdiPlusIcon from '~icons/mdi/plus' -const { formState, validateInfos, setAdditionalValidations, sqlUi, onDataTypeChange, onAlter } = useColumnCreateStoreOrThrow() +const { formState, setAdditionalValidations } = useColumnCreateStoreOrThrow() let options = $ref([]) const colorMenus = $ref({}) const colors = $ref(enumColor.light) +const inputs = ref() const validators = { 'colOptions.options': [ { - validator: (_: any, opt: any) => { + validator: (_: any, _opt: any) => { return new Promise((resolve, reject) => { for (const opt of options) { if (!opt.title.length) { @@ -74,6 +75,13 @@ onMounted(() => { op.title = op.title.replace(/^'/, '').replace(/'$/, '') } }) + +// focus last created input +watch(inputs, () => { + if (inputs.value?.$el) { + inputs.value.$el.focus() + } +}) - +