Skip to content

Commit

Permalink
fix(Mac): horizontal scrolling when shift key is held
Browse files Browse the repository at this point in the history
  • Loading branch information
KKishikawa committed Jan 14, 2024
1 parent 3e8dabc commit e3c5b61
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/web/src/datagrid/DataGridCore.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -1272,7 +1272,11 @@
function handleGridWheel(event) {
if (event.shiftKey) {
scrollHorizontal(event.deltaY, event.deltaX);
// Convert vertical scrolling to horizontal if shift key is held down.
// This is handled at a higher level on MacOS.
const shiftConvert = !isMac();
const [dx, dy] = shiftConvert ? [event.deltaY, event.deltaX] : [event.deltaX, event.deltaY];
scrollHorizontal(dx, dy);
} else {
scrollHorizontal(event.deltaX, event.deltaY);
scrollVertical(event.deltaX, event.deltaY);
Expand Down

0 comments on commit e3c5b61

Please sign in to comment.