Captures in this browser: every storage change rebuilds the list and drops keyboard focus #17
Labels
No labels
bug
documentation
enhancement
performance
security
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo-chromium#17
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found on 2026-09-29 in a read-only review of postulo-chromium at
7998de372, reading howsrc/captures.jsredraws its list.Any change to a capture key replaces every item of the list on Captures in this browser. The button that had focus is destroyed with its item, so focus falls back to the document body and a keyboard or screen-reader user is sent back to the top of the page with nothing said about where they are.
src/captures.js:171-182,draw():$("list").replaceChildren(...records.map((record) => item(record, when)));, with no focus handling;src/captures.js:206-219, thestorage.onChangedlistener that callsdraw()for any capture key. Only an open editor defers the redraw (:172-175), and closing the editor removes its panel, and the focused Save or Cancel, the same way.data-actionand each item adata-id. Before replacing the list, note the focused element's id and action; afterwards focus the same control in the new item, or, when the item is gone (deleted, cleared), the next item's first button, or the list's heading. Alternatively, update changed items in place and remove deleted ones, so untouched items keep their focus. Announce the outcome through the existing#statuslive region, assend()already does.Done when
test/captures.test.mjs) draws a list of three captures, focuses Delete on the second, removes it through the store, and asserts that focus is on a control of the third item rather than ondocument.body.