BREAKING CHANGE: Removed the selection flash from `select`, `combobox` and `listbox`, along with APIs for delaying selection feedback. #### Select and Combobox `select` and `combobox` now show the chosen label while the popup starts closing, without waiting for a selection flash or label delay. Their change events fire after the displayed label and hidden form value update, so handlers can read the new value from `FormData` before closing finishes. `combobox` also selects the input text immediately. `select.Context` no longer accepts `labelSwapDelayMs`, since the selected label now updates immediately. Remove the prop when upgrading: ```diff - + ``` The `data-select-flash` and `data-combobox-flash` attributes are no longer set. Remove their CSS rules; existing selected and highlighted styles continue to apply: ```diff css({ '&[aria-selected="true"]': { background: 'var(--selected-background)' }, - '&[data-select-flash]': { background: 'var(--flash-background)' }, - '&[data-combobox-flash]': { background: 'var(--flash-background)' }, }) ``` #### Custom Listboxes `listbox.Context` no longer accepts `flashSelection`, `selectionFlashAttribute` or `onSelectSettled`. Move work from `onSelectSettled` into `onSelect`, which runs synchronously: ```diff saveSelection(value, option?.label)} + onSelect={(value, option) => { + onSelect(value, option) + saveSelection(value, option?.label) + }} onHighlight={onHighlight} > ``` `onSelect` receives the new selection before your component renders the updated value. Use its `value` and `option` arguments for selection-dependent work, as above. If your old `onSelectSettled` callback read rendered DOM or form fields, wait for your component's update before reading them: ```diff { + onSelect={async (nextValue) => { value = nextValue - handle.update() + await handle.update() + saveForm(new FormData(form)) }} - onSelectSettled={() => saveForm(new FormData(form))} onHighlight={onHighlight} > ``` `ListboxRef.select()` and `ListboxRef.selectActive()` now return `void` instead of a promise. Listbox continues accepting selection and highlight requests while async callbacks run. If selecting closes your custom popup, use its open state to ignore further selection and highlight requests until it reopens. Set `open = false` before any awaited work: ```diff { + if (!open) return + open = false value = nextValue void handle.update() }} onHighlight={(nextActiveValue) => { + if (!open) return activeValue = nextActiveValue void handle.update() }} > ``` `select` and `combobox` already handle this themselves. The `data-listbox-flash` attribute is no longer set. Remove its CSS rule; existing selected and highlighted styles continue to apply: ```diff css({ '&[aria-selected="true"]': { background: 'var(--selected-background)' }, - '&[data-listbox-flash]': { background: 'var(--flash-background)' }, }) ```