Skip to content

Conversation

@surajrathod007
Copy link
Contributor

@surajrathod007 surajrathod007 commented Aug 17, 2025

This PR fixes a bug in google_maps_flutter_web where consumeTapEvents = false was still consuming tap events for Circle and Polygon overlays.

Previously, even when consumeTapEvents was set to false, taps on circles or polygons would prevent events from reaching the map beneath them. With this fix, the behavior is now consistent with mobile platforms — taps pass through when consumeTapEvents = false.

Fixes flutter/flutter#173921

Version and Changelog

  • Bumped version: 0.5.12+2 → 0.5.13
  • Added CHANGELOG entry for this fix.

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2 3

In the Google Maps JS API, CircleOptions.clickable and PolygonOptions.clickable
default to true. The web implementation did not explicitly set these values,
causing shapes to always consume tap events regardless of consumeTapEvents.

Explicitly setting clickable fixes the issue so GoogleMap.onTap is triggered
when consumeTapEvents = false.
@surajrathod007 surajrathod007 requested a review from ditman as a code owner August 17, 2025 09:11
@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@google-cla
Copy link

google-cla bot commented Aug 17, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request addresses a bug where consumeTapEvents = false was not being correctly handled for Circles and Polygons on the web, causing them to consume tap events instead of letting them pass through to the map. The fix involves mapping the consumeTapEvents property to the clickable option in the Google Maps JavaScript API for both circles and polygons. My review includes a suggestion to improve the changelog entry for stylistic consistency and points out that the fix is incomplete as it does not cover Polylines, which are also affected by the same issue.

@mdebbar mdebbar requested review from mdebbar and removed request for ditman August 20, 2025 20:06
Copy link
Contributor

@mdebbar mdebbar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this issue!

The fix looks good to me. Would you mind doing the same for Polyline too? That would ensure the fix is applied consistently across all shapes.

@mdebbar mdebbar added the triage-web Should be looked at in web triage label Aug 20, 2025
@surajrathod007 surajrathod007 changed the title [google_maps_flutter_web] Fix consumeTapEvents for Circles and Polygons (#173921) [google_maps_flutter_web] Fix consumeTapEvents for Circles, Polygons & Polylines (#173921) Aug 21, 2025
@surajrathod007
Copy link
Contributor Author

Thanks for fixing this issue!

The fix looks good to me. Would you mind doing the same for Polyline too? That would ensure the fix is applied consistently across all shapes.

@mdebbar Thanks for the feedback!

I’ve applied the same fix for Polyline as well, so it’s now consistent across all shapes.
Please let me know if there’s anything else you’d like me to update in this PR.

Copy link
Contributor

@mdebbar mdebbar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 (I saw this on Discord looking for another review, I'm not expert in this package but the changes look good to me.)

@mdebbar mdebbar added the autosubmit Merge PR when tree becomes green via auto submit App label Aug 23, 2025
@auto-submit auto-submit bot merged commit 7ace630 into flutter:main Aug 23, 2025
80 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 25, 2025
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Aug 25, 2025
flutter/packages@092d832...fe66130

2025-08-23 engine-flutter-autoroll@skia.org Roll Flutter from
26bb33b to edd434a (14 revisions) (flutter/packages#9874)
2025-08-23 surajsinhrathod75@gmail.com [google_maps_flutter_web] Fix
consumeTapEvents for Circles, Polygons & Polylines (#173921)
(flutter/packages#9838)
2025-08-22 10687576+bparrishMines@users.noreply.github.com
[interactive_media_ads] Fixes Android IllegalStateException caused by
uninitalized `MediaPlayer` (flutter/packages#9861)
2025-08-22 engine-flutter-autoroll@skia.org Roll Flutter from
d2ac021 to 26bb33b (20 revisions) (flutter/packages#9872)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
mboetger pushed a commit to mboetger/flutter that referenced this pull request Sep 18, 2025
…r#174373)

flutter/packages@092d832...fe66130

2025-08-23 engine-flutter-autoroll@skia.org Roll Flutter from
26bb33b to edd434a (14 revisions) (flutter/packages#9874)
2025-08-23 surajsinhrathod75@gmail.com [google_maps_flutter_web] Fix
consumeTapEvents for Circles, Polygons & Polylines (flutter#173921)
(flutter/packages#9838)
2025-08-22 10687576+bparrishMines@users.noreply.github.com
[interactive_media_ads] Fixes Android IllegalStateException caused by
uninitalized `MediaPlayer` (flutter/packages#9861)
2025-08-22 engine-flutter-autoroll@skia.org Roll Flutter from
d2ac021 to 26bb33b (20 revisions) (flutter/packages#9872)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
korca0220 pushed a commit to korca0220/flutter that referenced this pull request Sep 22, 2025
…r#174373)

flutter/packages@092d832...fe66130

2025-08-23 engine-flutter-autoroll@skia.org Roll Flutter from
26bb33b to edd434a (14 revisions) (flutter/packages#9874)
2025-08-23 surajsinhrathod75@gmail.com [google_maps_flutter_web] Fix
consumeTapEvents for Circles, Polygons & Polylines (flutter#173921)
(flutter/packages#9838)
2025-08-22 10687576+bparrishMines@users.noreply.github.com
[interactive_media_ads] Fixes Android IllegalStateException caused by
uninitalized `MediaPlayer` (flutter/packages#9861)
2025-08-22 engine-flutter-autoroll@skia.org Roll Flutter from
d2ac021 to 26bb33b (20 revisions) (flutter/packages#9872)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Jaineel-Mamtora pushed a commit to Jaineel-Mamtora/flutter_forked that referenced this pull request Sep 24, 2025
…r#174373)

flutter/packages@092d832...fe66130

2025-08-23 engine-flutter-autoroll@skia.org Roll Flutter from
26bb33b to edd434a (14 revisions) (flutter/packages#9874)
2025-08-23 surajsinhrathod75@gmail.com [google_maps_flutter_web] Fix
consumeTapEvents for Circles, Polygons & Polylines (flutter#173921)
(flutter/packages#9838)
2025-08-22 10687576+bparrishMines@users.noreply.github.com
[interactive_media_ads] Fixes Android IllegalStateException caused by
uninitalized `MediaPlayer` (flutter/packages#9861)
2025-08-22 engine-flutter-autoroll@skia.org Roll Flutter from
d2ac021 to 26bb33b (20 revisions) (flutter/packages#9872)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App p: google_maps_flutter platform-web triage-web Should be looked at in web triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[google_maps_flutter_web] consumeTapEvents = false still consumes tap events for Circles, Polygons & Polylines

4 participants