Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mouse events propagating through the SuggestionBox to the underlying HTMLElementView #495

Merged
merged 2 commits into from
Jun 4, 2023

Conversation

BenjiFarquhar
Copy link
Contributor

@BenjiFarquhar BenjiFarquhar commented Jun 2, 2023

Flutter Web has a bug where when you place widgets on top of HtmlElementView, the click events propagate to the HtmlElementView. See 98507. This presents itself when placing the TypeAheadFormField on a google_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.

Screenshot 2023-06-02 at 5 00 08 PM

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, the PointerInterceptor needs to be applied there, not in the client code using this package. I've also added it to the TextField which experienced the same issue.

@sjmcdowall sjmcdowall merged commit 1e55fe5 into AbdulRahmanAlHamali:master Jun 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants