fix horizontal scroll via shift+wheel on mac (#1528)

pull/1530/head
David Luzar 5 years ago committed by GitHub
parent 32e56aba3e
commit 4aa1784ba3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -2570,7 +2570,8 @@ class App extends React.Component<any, AppState> {
// scroll horizontally when shift pressed
if (event.shiftKey) {
this.setState(({ zoom, scrollX }) => ({
scrollX: normalizeScroll(scrollX - deltaY / zoom),
// on Mac, shift+wheel tends to result in deltaX
scrollX: normalizeScroll(scrollX - (deltaY || deltaX) / zoom),
}));
return;
}

Loading…
Cancel
Save