Skip to content

fix: let the burger click of the mobile menu reach the document - #9

Merged
JDCyllene merged 1 commit into
CylleneDigital:mainfrom
JDCyllene:fix/mobile-menu-burger-click
Oct 14, 2026
Merged

JDCyllene merged 1 commit into
CylleneDigital:mainfrom
JDCyllene:fix/mobile-menu-burger-click

Conversation

@JDCyllene

Copy link
Copy Markdown
Member

What this pull request does

In mega menu mode, the mobile menu controller listened to the burger in the capture phase and called stopImmediatePropagation(), so that Bootstrap's offcanvas could not handle the click. The burger of the mega menu carries no data-bs-toggle, so Bootstrap never handled it; stopping the event only hid the click from the listeners delegated on the document, such as analytics click triggers.

  • The controller listens to the burger in the bubbling phase and lets the click go on. It still binds the burger by id: the button sits outside the drawer, out of reach of a data-action.
  • A browser scenario covers the drawer: opened from a real click on the burger at a mobile width, drilled into a taxon, closed with Escape. The documented scenario counts follow (48 scenarios, 6 in Chrome).

The change ships in the shop JavaScript: shops get it with the next patch release, after rebuilding their assets.

Points to watch

  • Tests pass (vendor/bin/phpunit, vendor/bin/behat --strict)
  • PHPStan and ECS are green
  • If the schema changed: a new migration is added, and sh tests/check-schema-drift.sh prints nothing (MySQL or PostgreSQL)
  • UPGRADE.md is up to date if the public contract changes (traits and interfaces, Twig hooks and functions, grid query)
  • A decision taken or reversed has its record in docs/adr/
  • No customer data, shop secrets or pre-production URLs appear in the code, the tests or this description

The mobile menu controller listened to the burger in the capture phase and stopped the event, so
that Bootstrap's offcanvas could not handle it. The burger of the mega menu carries no
data-bs-toggle, so Bootstrap never handled it, while stopping the event hid the click from the
listeners delegated on the document (analytics click triggers).

The controller now listens to the burger in the bubbling phase and lets the click go on. A browser
scenario opens the drawer from the burger, drills into a taxon and closes it with Escape.
@JDCyllene
JDCyllene requested a review from a team as a code owner October 14, 2026 13:57
@JDCyllene
JDCyllene merged commit 1a0ae20 into CylleneDigital:main Oct 14, 2026
19 checks passed
@JDCyllene
JDCyllene deleted the fix/mobile-menu-burger-click branch October 14, 2026 14:04
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.

1 participant