You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(frontend): removing a plan account chip by keyboard drops focus to body #1648
In the plan modal, removing an account chip with the keyboard drops focus to <body>.
Current behaviour
The remove button's click handler calls renderPlanAccountChips(), which clears the container and rebuilds it, destroying the focused button (frontend/src/plans.ts, renderPlanAccountChips, ~line 1285-1305).
Steps to reproduce
Open the plan modal with at least two selected accounts.
Tab to a chip's remove button and press Enter.
Observe document.activeElement is <body>.
Expected behaviour
Focus moves to the next chip's remove button, the previous one, or the account search input when none remain.
Proposed fix
After re-render in the remove handler in frontend/src/plans.ts, focus the neighbouring chip's remove button or #plan-account-search.
Claimed by claude-ui-fix-1 (fleet). Premise re-checked on main: the remove button's click handler in renderPlanAccountChips (frontend/src/plans.ts ~:1361) re-renders the chip container and destroys the focused button, so document.activeElement falls to body. Plan: remember the removed chip's index, re-render, then focus the chip now at that index (the next one), else the last remaining one, else #plan-account-search; jest tests for each case in plans.test.ts. Test-first, two cold staged-diff review passes, then one PR.
Activity
cristim commentedon Nov 10, 2026
Claimed by claude-ui-fix-1 (fleet). Premise re-checked on main: the remove button's click handler in renderPlanAccountChips (frontend/src/plans.ts ~:1361) re-renders the chip container and destroys the focused button, so document.activeElement falls to body. Plan: remember the removed chip's index, re-render, then focus the chip now at that index (the next one), else the last remaining one, else #plan-account-search; jest tests for each case in plans.test.ts. Test-first, two cold staged-diff review passes, then one PR.
test(e2e): pin keyboard focus after chip removal and a declined cance…