Browse Source

fix(nc-gui): if cell is active and document.activeElement is different then prevent selectedCellKeyupListner event

pull/9983/head
Ramesh Mane 2 days ago
parent
commit
3d32182717
  1. 3
      packages/nc-gui/composables/useSelectedCellKeyupListener/index.ts
  2. 1
      packages/nc-gui/utils/browserUtils.ts

3
packages/nc-gui/composables/useSelectedCellKeyupListener/index.ts

@ -7,7 +7,8 @@ function useSelectedCellKeyupListener(
{ immediate = false }: { immediate?: boolean } = {},
) {
const finalHandler = (e: KeyboardEvent) => {
if (cmdKActive()) return
if (cmdKActive() || isExpandedFormOpenExist() || isExpandedCellInputExist() || isFieldEditOrAddDropdownOpen()) return
// TODO: Check if their is any active element which is outside grid then return
handler(e)
}

1
packages/nc-gui/utils/browserUtils.ts

@ -14,6 +14,7 @@ export const isActiveInputElementExist = () => {
!!document.activeElement?.getAttribute('contenteditable')
)
}
export const isFieldEditOrAddDropdownOpen = () => document.querySelector('.nc-dropdown-edit-column.active')
export const getScrollbarWidth = () => {
const outer = document.createElement('div')
outer.style.visibility = 'hidden'

Loading…
Cancel
Save