Escape does not close popups and menus #46
Labels
No labels
bug
chore
data
feature
frontend
good first issue
intermediate
needs/docs
needs/research
needs/upstream
type/bug
type/external
type/feature
type/refactor
urgency
high
urgency
immediate
urgency
low
urgency
medium
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
ScottyLabs/cal#46
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What's wrong
Pressing Escape does not close the event popover, the account menu, modal dialogs (for example Upload), or the course options menu. Keyboard users have to find the close button or click outside.
How to reproduce
aria-expanded="true".Expected
Escape closes each of these, and focus goes back to the control that opened it.
Where to look
web/src/app/components/EventPopover.tsx: the panel isstaticand its open state lives in ModalRender, so nothing callsonCloseon Escape.web/src/app/components/UserMenu.tsx: closes only on an outsidemousedown; add akeydownlistener in the same effect.web/src/app/components/Modal.tsx: no key handling. Many dialogs use it, so one fix covers them all.web/src/app/components/Accordion.tsx: Headless UI'sMenushould handle Escape by itself. Reproduce first; a likely suspect is the older<Transition>wrapper aroundMenu.Items(Headless UI v2 uses thetransitionprop on the items instead).Done when
aria-expandedgoes back to false.