Browse Source

fix: blur event on outside click

pull/6500/head
sreehari jayaraj 1 year ago
parent
commit
4f9851b19e
  1. 2
      packages/nc-gui/components/cell/MultiSelect.vue
  2. 1
      packages/nc-gui/components/cell/SingleSelect.vue
  3. 5
      packages/nc-gui/components/smartsheet/Cell.vue

2
packages/nc-gui/components/cell/MultiSelect.vue

@ -321,6 +321,8 @@ const handleClose = (e: MouseEvent) => {
!aselect.value.$el.contains(e.target) && !aselect.value.$el.contains(e.target) &&
!document.querySelector('.nc-dropdown-multi-select-cell.active')?.contains(e.target as Node) !document.querySelector('.nc-dropdown-multi-select-cell.active')?.contains(e.target as Node)
) { ) {
// loose focus when clicked outside
isEditable.value = false
isOpen.value = false isOpen.value = false
} }
} }

1
packages/nc-gui/components/cell/SingleSelect.vue

@ -217,6 +217,7 @@ const onKeydown = (e: KeyboardEvent) => {
const onSelect = () => { const onSelect = () => {
isOpen.value = false isOpen.value = false
isEditable.value = false
} }
const cellClickHook = inject(CellClickHookInj, null) const cellClickHook = inject(CellClickHookInj, null)

5
packages/nc-gui/components/smartsheet/Cell.vue

@ -189,11 +189,6 @@ onMounted(() => {
intersectionObserver.value?.observe(elementToObserve.value!) intersectionObserver.value?.observe(elementToObserve.value!)
}) })
// remove border of element when clicked outside
onClickOutside(elementToObserve as any, () => {
editEnabled.value = false
})
// disconnect the observer when the cell is unmounted // disconnect the observer when the cell is unmounted
onUnmounted(() => { onUnmounted(() => {
intersectionObserver.value?.disconnect() intersectionObserver.value?.disconnect()

Loading…
Cancel
Save