Browse Source

fix(nc-gui): if cell is active and document active element is outside grid then prevent event listner

pull/9983/head
Ramesh Mane 2 days ago
parent
commit
70f22c6943
  1. 13
      packages/nc-gui/composables/useSelectedCellKeyupListener/index.ts

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

@ -12,10 +12,19 @@ function useSelectedCellKeyupListener(
/** /**
* If `useSelectedCellKeyupListener` used for grid cell and active element is not in grid then prevent * If `useSelectedCellKeyupListener` used for grid cell and active element is not in grid then prevent
*/ */
if (isGridCell && (isExpandedFormOpenExist() || isExpandedCellInputExist() || isFieldEditOrAddDropdownOpen())) { if (isGridCell) {
if (isExpandedFormOpenExist() || isExpandedCellInputExist() || isFieldEditOrAddDropdownOpen()) {
return return
} }
// TODO: Check if their is any active element which is outside grid then return
if (
isActiveInputElementExist() &&
!(document.activeElement as HTMLElement).closest('table, .nc-group-table, .nc-grid-wrapper')
) {
return
}
}
handler(e) handler(e)
} }

Loading…
Cancel
Save