Skip to content

Bug: task dialog leaves keyboard focus on the background board #3557

Closed

Description

@yannickmonney

Observed locally

On commit ac2b7a574d06823687593a80064dedefa3861cdc, opening a task from a project's board leaves keyboard focus on the background task card although the visible dialog has role="dialog" and aria-modal="true". Pressing Tab then focuses that background card's Priority button; its tooltip is rendered over the modal. A keyboard user does not enter the task they opened.

Environment: isolated localhost app, Chromium, seeded test workspace. No production testing. This violates manual box TASK-A2 and the intended keyboard path in TASK-A1.

Reproduce

  1. Open a project task board with at least one task.
  2. Focus the task title button and press Enter.
  3. Observe the dialog, then press Tab without clicking inside it.
  4. Inspect document.activeElement: it is the background card's aria-label="Priority" button, outside the dialog. Background cards remain exposed in the accessibility tree.

The same initial outside focus occurs on pointer opening. Clicking Edit inside the dialog transfers focus inside and recovers the trap, so there is a pointer workaround. Escape after the background Priority tooltip is shown dismisses the tooltip first; a second Escape closes the task.

Expected

Opening a task transfers focus into the modal, Tab/Shift+Tab stay inside, and Escape closes it and restores the originating card. Keep the requested quiet loading appearance without leaving focus behind the overlay.

Root cause and scope

services/platform/app/features/tasks/components/task-modal.tsx cancels edit-mode onOpenAutoFocus without actually focusing the dialog. Reuse the shared dialog/focus contract; sweep board and list entry, loading/deep-link entry, create mode, and the responsive sheet. Avoid a second custom focus-trap implementation.

Acceptance

  • Reproduce with a real browser on localhost, then add a regression for Enter → Tab/Shift+Tab → Escape.
  • Cover loaded and loading task openings and focus restoration to the correct card.
  • Verify create-dialog autofocus and mobile details are preserved.
  • Follow AGENTS.md, design/, the normal branch/PR workflow, and affected checks. No production QA.

Evidence captured during the local run: tale-fleet-task-modal-focus.png (modal plus background Priority tooltip) and the active-element/AX observations. No console errors were recorded for these task flows.

Activity

  1. added
    priority: medium
    bug
    service: platform
    on Sep 27, 2026
  2. yannickmonney commented on Sep 27, 2026

    @yannickmonney
    ContributorAuthor

    Implementation is in progress on branch fix/task-dialog-keyboard-focus in an isolated checkout. Local browser acceptance will cover entry focus, Tab/Shift+Tab containment, Escape restoration, and desktop/mobile behavior. No production testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugpriority: mediumservice: platform

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions