Skip to content

fix(web): stop a marker click from also dropping a pin on the map - #689

Merged
Medformatik merged 1 commit into
mainfrom
fix/map-marker-click-ownership
Oct 30, 2026
Merged

Medformatik merged 1 commit into
mainfrom
fix/map-marker-click-ownership

Conversation

@Medformatik

@Medformatik Medformatik commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

What changed and why

Clicking the parked-car marker opened the parking panel and also dropped the grey pin and place card of a plain map click. MapLibre mounts DOM markers inside the map's event container, so a marker click also fires a map click at that point. Several markers left it unclaimed:

  • the location dot, which also dropped a pin and closed the place panel
  • the arrival parking markers
  • route waypoints: a tap filled the next empty waypoint with the waypoint's own position
  • the selected route pill
  • the dropped pin itself: a tap re-dropped it a pin's height higher
Before After
Before: clicking the parked car opens the parking panel and also drops a grey pin and its place card After: clicking the parked car opens only the parking panel

Every marker now handles clicks through bindMapMarkerActivation. It claims the click through the existing map click ownership with a new marker owner. Every map click handler already ignores owned clicks.

  • Claimed, not stopped. The click still reaches listeners outside the map, so a marker click now closes the right-click menu. That includes the pins and pills that used to stop propagation.
  • Pickers keep priority. A click an active picker owns stays the picker's: parking reposition, crowd report, measurement or travel time.
  • Action-less pins stay see-through, so a hover pin over a feature still lets that feature take the click.

A static test requires each file that creates a marker to bind it, apart from three listed pass-through markers. It also requires every map click handler to consult ownership. The integration system docs describe the rule.

Verification

  • Local checks: pnpm check-types (web) passes, and Biome passes in the pre-commit hook.
  • Full Vitest: 24,118 passed and 1 failed. The failure is a load-sensitive timing budget in road-conditions dedupe (5.4 s against 5 s), code this PR doesn't touch. It passes on its own.
  • New tests: they fail against main's marker code and pass with this change.
  • Real app, using next dev against the production API with a parked car in local storage:
    • clicking the car opens only the parking panel
    • a marker click closes an open context menu
    • "Change location" still takes a point on the badge
  • Not run by hand: the location dot, arrival parking, waypoints and route pills (tests and the static check cover them), and touch devices.

Release and upgrade impact

Product impact: ordinary

MapLibre mounts marker elements inside the map's event container, so a click
on a marker also fires a map click at that point. The parked-car marker, the
location dot, the arrival parking markers, waypoints, the selected route pill
and the dropped pin left that click unclaimed: clicking the parked car opened
its panel and also dropped a grey pin, and layer handlers could open whatever
lay beneath a marker.

bindMapMarkerActivation now owns marker clicks for every marker. It claims the
click through map click ownership instead of stopping it, so map handlers
leave it alone while click-away dismissal still sees it, and a click an active
picker owns stays the picker's. A static test requires markers to bind
through it and every map click handler to consult ownership.
@Medformatik Medformatik self-assigned this Oct 30, 2026
@Medformatik Medformatik changed the title fix(map): let a DOM marker own the clicks that land on it fix(web): stop a marker click from also dropping a pin on the map Oct 30, 2026
@Medformatik
Medformatik enabled auto-merge (squash) October 30, 2026 14:34
@Medformatik
Medformatik disabled auto-merge October 30, 2026 15:08
@Medformatik
Medformatik merged commit d1c01ae into main Oct 30, 2026
32 of 45 checks passed
@Medformatik
Medformatik deleted the fix/map-marker-click-ownership branch October 30, 2026 15:08
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant