EasyCorp / EasyCorp/EasyAdminBundle

The mobile sidebar cannot be closed with the Escape key

Open Beginner friendly
#7,808 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
PHP
Stars
4.3k
Forks
1.1k
Avg merge
8d 2h
Merged PRs (30d)
11

Description

Description

The open mobile sidebar (hamburger menu) cannot be dismissed with the Escape key. The bundle's et() handler only toggles on the hamburger click and closes via the modal-backdrop click — there is no Escape handler (unlike the user dropdown, which the admin JS closes on Escape).

Expected

  • Escape should close the open mobile sidebar (remove ea-mobile-sidebar-visible and any backdrop), matching standard modal/drawer behaviour.

Workaround we use today (not viable upstream)

We had to add it in our own admin-custom.js:

document.addEventListener('keydown', function(e) {
    if (e.key === 'Escape' && document.body.classList.contains('ea-mobile-sidebar-visible')) {
        document.body.classList.remove('ea-mobile-sidebar-visible');
    }
});

This belongs in the bundle's et() alongside the toggler/backdrop close logic.

Environment

EasyAdmin v5.5.1 (@media (max-width:991px) responsive header / mobile sidebar).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the bundle's et() handler that currently responds to the hamburger and modal-backdrop clicks, and compare it with the admin JavaScript Escape handling for the user dropdown. Add coverage for dismissing the mobile sidebar with Escape, ensuring ea-mobile-sidebar-visible and its backdrop are cleared.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, php
Domain
frontend
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.