4e691691 Moved both chip pickers onto one shared shell
no ref
The tags field and the authors field were near-copies of the same
chips-in-a-field control, and had drifted: the authors field answered
Escape on the input and stopped the key, and drew a chip as a badge
wrapping a smaller remove button, while the tags field answered Escape on
the document and made the whole chip the button. Both also named a
listbox through `aria-controls` while it was not on screen.
`shared/pickers/chip-picker.tsx` now owns the open and highlight state,
the pointerdown and blur dismissal, the IME guard, Backspace removal, the
Arrow, Enter and Tab keyboard, the field and dropdown surfaces and the
combobox ARIA. The tag picker keeps the tag browse, its debounce and the
create row; the authors picker keeps the staff browse, its rows and its
load-error notice. The term the rows and the create offer read against is
trimmed by default and normalised by the caller when it queries with
something else, so an offer to create can never disagree with the query.
The drift is settled on the tags field's side, and Escape is now claimed
rather than left standing: a Radix layer registers its own capture
listener at mount and so still answers the key first, but a settings pane
listening on the window bubble bails on a prevented default, which is
what keeps a pane from closing along with the list inside it. A chip is a
single button named "Remove <name>", and `aria-controls` is written only
while the list is open, with `aria-expanded` carrying the state either
way. 006d8b25 Moved both chip pickers onto one shared shell
no ref
The tags field and the authors field were near-copies of the same
chips-in-a-field control, and had drifted: the authors field answered
Escape on the input and stopped the key, and drew a chip as a badge
wrapping a smaller remove button, while the tags field answered Escape on
the document and made the whole chip the button. Both also named a
listbox through `aria-controls` while it was not on screen.
`shared/pickers/chip-picker.tsx` now owns the open and highlight state,
the pointerdown and blur dismissal, the IME guard, Backspace removal, the
Arrow, Enter and Tab keyboard, the field and dropdown surfaces and the
combobox ARIA. The tag picker keeps the tag browse, its debounce and the
create row; the authors picker keeps the staff browse, its rows and its
load-error notice. The term the rows and the create offer read against is
trimmed by default and normalised by the caller when it queries with
something else, so an offer to create can never disagree with the query.
The drift is settled on the tags field's side, and Escape is now claimed
rather than left standing: a Radix layer registers its own capture
listener at mount and so still answers the key first, but a settings pane
listening on the window bubble bails on a prevented default, which is
what keeps a pane from closing along with the list inside it. A chip is a
single button named "Remove <name>", and `aria-controls` is written only
while the list is open, with `aria-expanded` carrying the state either
way. f9701187 Moved both chip pickers onto one shared shell
no ref
The tags field and the authors field were near-copies of the same
chips-in-a-field control, and had drifted: the authors field answered
Escape on the input and stopped the key, and drew a chip as a badge
wrapping a smaller remove button, while the tags field answered Escape on
the document and made the whole chip the button. Both also named a
listbox through `aria-controls` while it was not on screen.
`shared/pickers/chip-picker.tsx` now owns the open and highlight state,
the pointerdown and blur dismissal, the IME guard, Backspace removal, the
Arrow, Enter and Tab keyboard, the field and dropdown surfaces and the
combobox ARIA. The tag picker keeps the tag browse, its debounce and the
create row; the authors picker keeps the staff browse, its rows and its
load-error notice.
The drift is settled on the tags field's side: Escape leaves the default
standing so an outer layer still reads the key as its own dismissal once
the list has closed, and a chip is a single button named "Remove <name>".
`aria-controls` is now written only while the list is open, with
`aria-expanded` carrying the state either way.