mirror of
https://github.com/rowyio/rowy.git
synced 2025-12-16 11:47:50 +01:00
Merge pull request #1573 from iamanishroy/anish/upd/deselect-cell-on-next-page-load
Update: deselect cell on page load
This commit is contained in:
@@ -121,6 +121,7 @@ export default function Table({
|
|||||||
const [tablePage, setTablePage] = useAtom(tablePageAtom, tableScope);
|
const [tablePage, setTablePage] = useAtom(tablePageAtom, tableScope);
|
||||||
const setReactTable = useSetAtom(reactTableAtom, tableScope);
|
const setReactTable = useSetAtom(reactTableAtom, tableScope);
|
||||||
|
|
||||||
|
const setSelectedCell = useSetAtom(selectedCellAtom, tableScope);
|
||||||
const updateColumn = useSetAtom(updateColumnAtom, tableScope);
|
const updateColumn = useSetAtom(updateColumnAtom, tableScope);
|
||||||
|
|
||||||
// Get user settings and tableId for applying sort sorting
|
// Get user settings and tableId for applying sort sorting
|
||||||
@@ -313,6 +314,8 @@ export default function Table({
|
|||||||
|
|
||||||
const { scrollHeight, scrollTop, clientHeight } = containerElement;
|
const { scrollHeight, scrollTop, clientHeight } = containerElement;
|
||||||
if (scrollHeight - scrollTop - clientHeight < 300) {
|
if (scrollHeight - scrollTop - clientHeight < 300) {
|
||||||
|
// deselect cell on next page load
|
||||||
|
setSelectedCell(null);
|
||||||
setTablePage((p) => p + 1);
|
setTablePage((p) => p + 1);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user