Browse Source

Merge pull request #4059 from nocodb/fix/4056-edit-column-autofocus-issue

Fix: Edit column -  focus title field only if there is no focused input element
pull/4064/head
Pranav C 2 years ago committed by GitHub
parent
commit
f6c9f8d214
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      packages/nc-gui/components/smartsheet/column/EditOrAdd.vue

7
packages/nc-gui/components/smartsheet/column/EditOrAdd.vue

@ -91,8 +91,11 @@ watchEffect(() => {
if (antInput.value && formState.value) { if (antInput.value && formState.value) {
// todo: replace setTimeout // todo: replace setTimeout
setTimeout(() => { setTimeout(() => {
antInput.value?.focus() // focus and select input only if active element is not an input or textarea
antInput.value?.select() if (document.activeElement === document.body || document.activeElement === null) {
antInput.value?.focus()
antInput.value?.select()
}
}, 300) }, 300)
} }
advancedOptions.value = false advancedOptions.value = false

Loading…
Cancel
Save