Skip to content

Fix: Escape on Task edit closes open overlays instead of the page#358

Merged
dkhalife merged 1 commit into
mainfrom
dkhalife/escape-keeps-task-edit-open
Jun 22, 2026
Merged

Fix: Escape on Task edit closes open overlays instead of the page#358
dkhalife merged 1 commit into
mainfrom
dkhalife/escape-keeps-task-edit-open

Conversation

@dkhalife

Copy link
Copy Markdown
Owner

Problem

On the Task edit page, a global keydown listener 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 in frontend/src/views/Tasks/TaskEdit.tsx that bails out of the page-close when:

  • The confirmation modal is open (existing behavior)
  • A MUI Joy Select/menu popup is open (detected via the [role=listbox]/[role=menu] portal that only exists while open) — e.g. the labels dropdown
  • A native date/time/datetime-local input is focused — the date-time picker

Now Escape dismisses the open dropdown/picker first, and only closes the edit page when nothing is open.

Copilot AI review requested due to automatic review settings June 22, 2026 11:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 keydown Escape 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

@dkhalife dkhalife merged commit 282e5d3 into main Jun 22, 2026
10 checks passed
@dkhalife dkhalife deleted the dkhalife/escape-keeps-task-edit-open branch June 22, 2026 12:03
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.

2 participants