Skip to content

Make images smaller using best-in-class codecs, right in the browser.

JavaScript

Allow mouse wheel on two-up handle. Fixes #49 (#54)

Jake Archibald3f18c927f175
diff --git a/src/components/output/index.tsx b/src/components/output/index.tsx
index 6321a90e..7728f319 100644
--- a/src/components/output/index.tsx
+++ b/src/components/output/index.tsx
@@ -65,8 +65,9 @@ export default class Output extends Component<Props, State> {
onRetargetableEvent(event: Event) {
const targetEl = event.target as HTMLElement;
if (!this.pinchZoomLeft) throw Error('Missing pinch-zoom element');
- // If the event is on the handle of the two-up, let it through.
- if (targetEl.closest('.' + twoUpHandle)) return;
+ // If the event is on the handle of the two-up, let it through,
+ // unless it's a wheel event, in which case always let it through.
+ if (event.type !== 'wheel' && targetEl.closest('.' + twoUpHandle)) return;
// If we've already retargeted this event, let it through.
if (this.retargetedEvents.has(event)) return;
// Stop the event in its tracks.