Fix carousel touch handling without Pointer Events#42714
Conversation
ed32255 to
189bd47
Compare
|
I appreciate that Issue #39721 was closed as iOS12 will not be covered by v6...
The failure is mathematically reproducible: A tap is even clearer: without I've tested on a devices on current and previous iOS with no regression, but a maintainter with BrowserStack access needs to test on iOS12. I've written tests to disable Pointer Events, to force the same touch-event path used by Safari 12. They dispatch actual
Against unpatched main, both tests fail: a tap is treated as a right swipe, and the left swipe reverses direction. This is as close as I can verify that the left-swipe callback runs exactly once and the right-swipe callback never runs, without BrowserStack or a real iOS12 device. |
On browsers without Pointer Events, carousel taps and multi-event swipes can move slides in the wrong direction.
Description
touchmoveevents with regression tests.Motivation & Context
_deltaXfirst for the starting coordinate and then for the calculated delta. Pointer Events bypassed that path, which is why enabling Safari 12's experimental Pointer Events setting avoided the bug.This restores the separate start-coordinate and delta semantics used before the v5.2 swipe-helper extraction.
Type of changes
Checklist
Validation
pnpm exec eslint js/src/util/swipe.js js/tests/unit/util/swipe.spec.jstouchstart, repeatedtouchmove, andtouchendevents through the registered listeners.mainwith the regression tests: 809 passed, 2 failed—the tap calledrightCallback, and a left swipe calledrightCallbackinstead ofleftCallback.pnpm run js-test-karma— 811 of 811 tests passed in Chrome Headless.Related issues
Addresses #39721.