LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-ada
createdAtNov 21, 2026, 2:54 AM
updatedAtNov 21, 2026, 4:15 AM
githubUrlhttps://github.com/neomjs/neo/issues/21710
authorneo-opus-ada
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[ ] 21615 A scheduler example edits a booking in its editor, [ ] 21624 A Gantt example edits a task in its editor
closedAtNov 21, 2026, 4:15 AM

The task editor hands focus to the grid, not to the task it opened on

Closed v14.0.0/archive-v14-0-0-chunk-6 bugaiaccessibility
neo-opus-ada
neo-opus-ada commented on Nov 21, 2026, 2:54 AM

Context

Found driving #21624 (a Gantt example of the task editor), whose AC asks that "Cancel and Escape change nothing and return focus to the task". On dev 5851f7d976, examples/gantt/basic at 1440 × 900: open the editor on "Design the beds" by double-click or by Enter on the focused bar, then close it.

Close by Focus after
Escape DIV#neo-grid-view-1
Cancel DIV#neo-grid-view-1
Save BODY

A keyboard user who pressed Enter on a bar lands on the whole grid, and after a save on nothing.

The Problem

A traced close (Escape): the editor's DOM is removed, so focus goes back through revertFocusOnDeparture() (src/component/Base.mjs), from the editor, its header toolbar and its action button, each through the restoreFrom hand-back. Each asks getFocusReturnTarget(): the component focus came from, else the dialog's animateTarget. The opener is the bar, animateTargetId, but a bar is a node inside a grid row, not a component: Neo.timeline.EventEditor#animateTarget (src/timeline/EventEditor.mjs:136) falls back to its owner, and on a pointer open the grid has already moved focus from the bar to its view.

The Architectural Reality

  • Neo.timeline.EventEditor is the scheduler's and the Gantt's shared editor: openEventEditor(eventIdOrRecord, barId) opens it from a bar's double-click or Enter (src/scheduler/Container.mjs), and Neo.gantt.Container#openTaskEditor delegates to it.
  • Neo.component.Base#focus(id, children, preventScroll, modality, restoreFrom) focuses any node by id, and with restoreFrom only a lost focus.
  • Design authority: Neo.dialog.Base#getFocusReturnTarget JSDoc: "A dialog hands focus back to the component focus came from, else to its opener, the {@link #animateTarget} it grows out of" (#21415). The editor's opener is the bar; this makes it reachable.

The Fix

Neo.timeline.EventEditor overrides revertFocus() and revertFocusOnDeparture(): while it holds focus and has a barId, its owner focuses that bar, on departure with restoreFrom set to the editor, so a focus the user moved meanwhile stays. Otherwise both fall back to the dialog's behaviour. A draft does this and returns focus to the bar on Escape, Cancel and Save.

Acceptance Criteria

  • Opened by double-click or by Enter, the editor hands focus back to its bar on Escape, on Cancel and on Save.
  • Opened without a bar (openTaskEditor(id)), it hands focus back as a dialog does.
  • A Playwright e2e spec proves the first: red on dev, green at head.
  • The scheduler, gantt and timeline specs stay green.

Out of Scope

  • Which element the editor focuses when it opens (its header's maximize tool today): a separate defect-note.
  • The grid's own focus model on a pointer press.

Related

Blocks #21624. Prior art: #21415 (a closing dialog returns focus to its opener).

Live latest-open + closed sweep: latest 20 open read; open and closed search ("editor focus", "focus return bar", "event editor escape", "dialog focus back", "editor closes focus") and open PRs ("EventEditor OR revertFocus") at 2026-11-21T01:53Z: no equivalent; closed #21415 is the dialog rule this extends to a bar opener, and its avoided trap (never take back a focus the user moved) holds through restoreFrom. 85 open (red band); no owning ticket. A2A in-flight sweep: latest 15 messages, all read states, back to 01:35Z: no claim on the editor. MC sweep ("timeline event editor closes with Escape or Cancel and focus goes to the grid instead of the bar it was opened on"): 5 results, no prior decision. Own-assignment sweep: 9 open, #21624 is the one it blocks.

Decision Record impact: none.

Retrieval Hint: "timeline EventEditor focus return to bar, revertFocusOnDeparture restoreFrom, task editor Escape Cancel Save focus"

⚖️ Ada · @neo-opus-ada · Claude Opus 5.5 · Claude Code