Fix: Escape on Task edit closes open overlays instead of the page#358
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts the Task Edit view’s global Escape-key handling so that pressing Escape dismisses active UI overlays (e.g., the labels dropdown / Joy Select popup or native date-time pickers) instead of immediately navigating away from the edit page and risking loss of in-progress changes.
Changes:
- Introduced an
isOverlayOpen()guard to detect when an overlay should consume Escape. - Updated the existing
keydownEscape handler to bail out when an overlay is detected, preserving the edit page state.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/views/Tasks/TaskEdit.tsx | Adds overlay detection logic and uses it to prevent Escape from closing the edit page when dropdowns/pickers are active. |
Copilot's findings
- Files reviewed: 1/1 changed files
- Comments generated: 0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On the Task edit page, a global
keydownlistener closed the entire page on Escape, only guarding against the confirmation modal. As a result, pressing Escape to dismiss an open overlay (the labels dropdown or a native date/time picker) closed the whole edit page and lost in-progress work.Fix
Added an
isOverlayOpen()guard infrontend/src/views/Tasks/TaskEdit.tsxthat bails out of the page-close when:Select/menu popup is open (detected via the[role=listbox]/[role=menu]portal that only exists while open) — e.g. the labels dropdowndate/time/datetime-localinput is focused — the date-time pickerNow Escape dismisses the open dropdown/picker first, and only closes the edit page when nothing is open.