Created
May 17, 2022 11:20
-
-
Save gabrielpetersson/a225eb988ea2a6096a3f90752c88a542 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (isSearchBarClosing) { | |
(async () => { | |
await wait(300); | |
if (gridApi == null) { | |
return; | |
} | |
const ranges = gridApi.getCellRanges(); | |
if (ranges?.length !== 1) { | |
return; | |
} | |
const range = ranges[0]!; | |
const startRowIndex = range.startRow?.rowIndex; | |
const endRowIndex = range.endRow?.rowIndex; | |
const isOnlyOneCellInRange = | |
startRowIndex != null && | |
(range.columns.length !== 1 || startRowIndex === endRowIndex); | |
if (!isOnlyOneCellInRange) { | |
return; | |
} | |
focusGridCell(startRowIndex, range.columns[0]!, gridApi); | |
})(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment