This repository was archived by the owner on Feb 25, 2025. It is now read-only.
[Web] Ignore pointer up and pointer cancel for unknown device #34070
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.

Description
This PR is an attempt to fix the
Unexpected null valueerror thrown when using the Chrome DevTools on mobile mode and clicking on the top left corner.Before this PR, the error is thrown because the
pointeruphandler expects that there was a previouspointerdownhandler which called_ensureSanitizerfor the device.This is not the case when opening DevTools and switching it to mobile mode, because :
PointerDeviceKind.touchinstead ofPointerDeviceKind.mouseand create a new pointerId on each pointer down event.htmlDOM element when the event is on the top left corner (elsewhere the target is Flutter Web glass pane). This is related to the<flt-semantics-placeholder>DOM element (the problem doesn't occur when this element is removed).The fix included in this PR is to ignore pointer up and pointer cancel events when the device is unknown. This is to improve the developer experience (especially when the debugger is configured to break on
Uncaught Exceptions).Alternative solutions :
Related Issue
Fixes flutter/flutter#105458
Tests
Adds 1 test.