From 39d897cd8395ca7bd37290eb1fe18eac0bf0daa7 Mon Sep 17 00:00:00 2001 From: Cole Lawrence Date: Fri, 24 Jun 2022 09:22:33 -0400 Subject: [PATCH] fix(SequenceEditor): horizontal scroll with shift in macOS Firefox --- .../DopeSheet/Right/HorizontallyScrollableArea.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/HorizontallyScrollableArea.tsx b/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/HorizontallyScrollableArea.tsx index 5168fc7..73c105d 100644 --- a/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/HorizontallyScrollableArea.tsx +++ b/theatre/studio/src/panels/SequenceEditorPanel/DopeSheet/Right/HorizontallyScrollableArea.tsx @@ -202,7 +202,12 @@ function useHandlePanAndZoom( const windowSize = oldRange.end - oldRange.start const speed = windowSize / sequenceLength - const delta = normalize(event.deltaY, [-50, 50]) + // if there's no deltaY, the browser is probably assigning to deltaX because of the shiftKey + // it appeared that Safari + Chrome continue to use deltaY with shiftKey, while FF on macOS + // updates the deltaX with deltaY unchanged. + // this is a little awkward with track pads + shift on macOS FF, but that's not a big deal + // since scrolling horizontally with macOS track pads is not necessary to hold shift. + const delta = normalize(event.deltaY || event.deltaX, [-50, 50]) const scaleFactor = delta * 0.05 * speed const newRange = mapValues(