Chrome error: Ignored attempt to cancel a touchmove event with cancelable=false
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 12.4k
- Forks
- 2.4k
- PR merge metrics
- No merged PRs in 30d
Description
### mapbox-gl-js version
3.14.0
### Browser and version
Chrome/138.0.0.0 on Android 10
### Expected behavior
_No response_
### Actual behavior
Chrome is logging an intervention via it's reporting api:
"Ignored attempt to cancel a touchmove event with cancelable=false, for example because scrolling is in progress and cannot be interrupted."
Because the logged messages were captured from report users I'm not certain exactly what they were doing with the map at the time. As far as I can tell the method that is triggering the warning is this one:
```
touchmove(e, points, mapTouches) {
const firstTouches = this._firstTwoTouches;
if (!firstTouches)
return;
e.preventDefault();
const [idA, idB] = firstTouches;
const a = getTouchById(mapTouches, points, idA);
const b = getTouchById(mapTouches, points, idB);
if (!a || !b)
return;
const pinchAround = this._aroundCenter ? null : a.add(b).div(2);
return this._move([
a,
b
], pinchAround, e);
}
```
Wrapping the `e.preventDefault()` with,
```
if (e.cancelable) {
e.preventDefault();
}
```
would probably resolve problem.
My bug report is very similar to an earlier resolved one, https://github.com/mapbox/mapbox-gl-js/issues/11961
### Link to the demonstration
_No response_
### Steps to trigger the unexpected behavior
_No response_
### Relevant log output
```shell
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the touchmove(e, points, mapTouches) entry point shown in the report and compare its behavior with the earlier issue #11961. Verify the warning scenario on Chrome for Android and confirm the completed change prevents the non-cancelable touchmove intervention; no test file is identified in the issue.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100