You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (ev.targetTouches.length === 2 && ev.changedTouches.length === 2) {
// Check if the two target touches are the same ones that started
// the 2-touch
const point1 = tpCache.findLastIndex(
(tp) => tp.identifier === ev.targetTouches[0].identifier,
);
const point2 = tpCache.findLastIndex(
(tp) => tp.identifier === ev.targetTouches[1].identifier,
);
if (point1 >= 0 && point2 >= 0) {
// ... omitted for brevity ...
} else {
// empty tpCache
tpCache = []; // <--- issue here
}
What did you expect to see?
The issue is pretty simple, during some quality update to the demos and tutorials, someone updated the variable declaration from var to const without realizing that the reassignment to an empty array is not permitted.
Do you have any supporting links, references, or citations?
Josh-Cena
added
good first issue
A good issue for newcomers to get started with.
and removed
needs triage
Triage needed by staff and/or partners. Automatically applied when an issue is opened.
labels
Jun 5, 2024
MDN URL
https://developer.mozilla.org/en-US/docs/Web/API/Touch_events/Multi-touch_interaction
What specific section or headline is this issue about?
Section "Global State"
What information was incorrect, unhelpful, or incomplete?
The included JS sample appears as such:
which conflicts with the code example as written for the Move/Pinch/Zoom handler see
What did you expect to see?
The issue is pretty simple, during some quality update to the demos and tutorials, someone updated the variable declaration from
var
toconst
without realizing that the reassignment to an empty array is not permitted.Do you have any supporting links, references, or citations?
No response
Do you have anything more you want to share?
No response
MDN metadata
Page report details
en-us/web/api/touch_events/multi-touch_interaction
The text was updated successfully, but these errors were encountered: