Fix mouse events propagating through the SuggestionBox to the underlying HTMLElementView #495
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.
Flutter Web has a bug where when you place widgets on top of
HtmlElementView
, the click events propagate to theHtmlElementView
. See 98507. This presents itself when placing theTypeAheadFormField
on agoogle_maps_flutter
map in web.It is observable in this situation, where the suggestion box drops over a clickable button, as shown below. When you select a suggestion above "view on google maps", it opens a new tab, the google maps web page, which displays the location details.
Flutter has created a widget that works around this issue: PointerInterceptor. It adds nothing to the widget tree in Android and iOS or if
intercepting
is set to false - which I have made the default.Since it occurs on the suggestion box created in the
TypeAheadFormField
, thePointerInterceptor
needs to be applied there, not in the client code using this package. I've also added it to theTextField
which experienced the same issue.