EasyCorp / EasyCorp/EasyAdminBundle
The mobile sidebar cannot be closed with the Escape key
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-visibleand 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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