mirror of
https://github.com/GoogleChromeLabs/squoosh.git
synced 2025-11-16 18:49:50 +00:00
@@ -65,8 +65,9 @@ export default class Output extends Component<Props, State> {
|
|||||||
onRetargetableEvent(event: Event) {
|
onRetargetableEvent(event: Event) {
|
||||||
const targetEl = event.target as HTMLElement;
|
const targetEl = event.target as HTMLElement;
|
||||||
if (!this.pinchZoomLeft) throw Error('Missing pinch-zoom element');
|
if (!this.pinchZoomLeft) throw Error('Missing pinch-zoom element');
|
||||||
// If the event is on the handle of the two-up, let it through.
|
// If the event is on the handle of the two-up, let it through,
|
||||||
if (targetEl.closest('.' + twoUpHandle)) return;
|
// 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 we've already retargeted this event, let it through.
|
||||||
if (this.retargetedEvents.has(event)) return;
|
if (this.retargetedEvents.has(event)) return;
|
||||||
// Stop the event in its tracks.
|
// Stop the event in its tracks.
|
||||||
|
|||||||
Reference in New Issue
Block a user