Rails I18n de-facto standard library for ActiveRecord model/data translation.
RSpec's 'test double' framework, with support for stubbing and mocking
Prevent wheel interfering with pinch
Using a macbook, a touchpad pinch gesture will trigger useGesture
's pinch event, as desired, but it will also trigger the wheel event. Except in Safari.
With this change, the wheel event handler bails if a pinch gesture is ongoing.
Tested in Firefox, Chrome and Safari on a macbook.
Fixes: #1638
feat(zoom): prevent wheel interfering with pinch
Using a macbook, a touchpad pinch gesture will trigger useGesture
's
pinch event, as desired, but it will also trigger the wheel event.
Except in Safari.
With this change, the wheel event handler bails if a pinch gesture is ongoing.
Fixes: #1638
One thing to try is to ignore wheel events while pinching, similar to how it's done in onDrag
:
onDrag: ({ event, pinching, cancel }) => {
if (pinching) { // <----
cancel();
dragEnd();
} else if (!(event instanceof KeyboardEvent)) {
dragMove(event);
}
},
I have noticed that the wheel handler (handleWheel
) is fired when pinching, as is handlePinch
. Occasionally, the two events scale in the opposite direction, causing the issue.
The zoom example in https://airbnb.io/visx/zoom-i demonstrates the issue.
https://user-images.githubusercontent.com/98786/214480791-32a4b3bf-d9bb-4776-82e8-9e13fde43cc5.mov
I'm seeing this in Firefox and Chrome, but not Safari, while using the pinch gesture using the touchpad.