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. 15
      packages/nc-gui/composables/useSelectedCellKeyupListener/index.ts

15
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 (isGridCell && (isExpandedFormOpenExist() || isExpandedCellInputExist() || isFieldEditOrAddDropdownOpen())) {
return
if (isGridCell) {
if (isExpandedFormOpenExist() || isExpandedCellInputExist() || isFieldEditOrAddDropdownOpen()) {
return
}
if (
isActiveInputElementExist() &&
!(document.activeElement as HTMLElement).closest('table, .nc-group-table, .nc-grid-wrapper')
) {
return
}
}
// TODO: Check if their is any active element which is outside grid then return
handler(e)
}

Loading…
Cancel
Save