Skip to content

Commit

Permalink
fix issue with page down when running with vuu server data
Browse files Browse the repository at this point in the history
  • Loading branch information
heswell committed Jan 24, 2024
1 parent 6dba800 commit a9bcbe5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
14 changes: 12 additions & 2 deletions vuu-ui/packages/vuu-table/src/useKeyboardNavigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,19 @@ NavigationHookProps) => {
break;
}
}
requestAnimationFrame(() => {
// Introduce a delay to allow the scroll operation to complete,
// which will trigger a range reset and rerender of rows. We
// might need to tweak how this works. If we introduce too big
// a delay, we risk seeing the newly rendered rows, with the focus
// still on the old cell, which will be apparent as a brief flash
// of the old cell focus before switching to correct cell. If we were
// to change the way re assign keys such that we can guarantee that
// when we page down, rows in same position get same keys, then same
// cell would be focussed in new page as previous and issue would not
// arise.
setTimeout(() => {
resolve([newRowIdx, colIdx]);
});
}, 35);
}),
[requestScroll, rowCount, viewportRowCount]
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ export const useFilterTable = ({ tableSchema }: FilterTableFeatureProps) => {
onAvailableColumnsChange: handleAvailableColumnsChange,
onConfigChange: handleTableConfigChange,
onFeatureInvocation: handleVuuFeatureInvoked,
// renderBufferSize: 50,
renderBufferSize: 0,
renderBufferSize: 10,
};

// It is important that these values are not assigned in advance. They
Expand Down

0 comments on commit a9bcbe5

Please sign in to comment.