Open smhigley opened 2 weeks ago
Package & Exports | Baseline (minified/GZIP) | PR | Change |
---|---|---|---|
react-combobox Combobox (including child components) |
100.496 kB 33.156 kB |
101.45 kB 33.342 kB |
954 B 186 B |
react-combobox Dropdown (including child components) |
101.129 kB 33.096 kB |
102.088 kB 33.285 kB |
959 B 189 B |
react-timepicker-compat TimePicker |
103.487 kB 34.632 kB |
104.444 kB 34.803 kB |
957 B 171 B |
š¤ This report was generated against 8820c131f5b6d0509c2781f741b07932f37a4ff5
@fluentui/react-components
)No significant results to display.
Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
---|---|---|---|---|---|
Avatar | mount | 634 | 653 | 5000 | |
Button | mount | 282 | 309 | 5000 | |
Field | mount | 1139 | 1144 | 5000 | |
FluentProvider | mount | 695 | 697 | 5000 | |
FluentProviderWithTheme | mount | 83 | 84 | 10 | |
FluentProviderWithTheme | virtual-rerender | 36 | 34 | 10 | |
FluentProviderWithTheme | virtual-rerender-with-unmount | 73 | 76 | 10 | |
MakeStyles | mount | 855 | 850 | 50000 | |
Persona | mount | 1745 | 1696 | 5000 | |
SpinButton | mount | 1359 | 1365 | 5000 | |
SwatchPicker | mount | 1489 | 1540 | 5000 |
Related to #31140 and #31235
Essentially this moves the initial
activeDescendantController
setting logic fromuseComboboxBaseState
touseListbox
, so it runs when the listbox is first renders instead of based on the change inopen
state.That both makes combobox/dropdown
aria-activedescendant
logic a bit more straightforward (the attribute is set if the referenced option exists), and also makes a standalone listbox work.It also moves a couple option lookup functions to the context, so that Listbox can access them (previously the
getOptionById
logic inonFocus
wasn't working when not a standalone widget, since it didn't have access to the parent combobox's option collection).Previous Behavior
The original issue was that listbox did not set the initial activedescendant. The first fix to that issue did so on focus, but that caused issues when clicking also set focus (and reset the activedescendant, potentially causing scroll & jumping).
New Behavior
There's no reason Listbox should not always have
aria-activedescendant
set while it's present on the page, so this change moves the initial activedescendant logic from the combobox (which handled it when opened) to the listbox (which handles it when initially rendered).There is a very subtle difference between the two, since the Listbox is rendered when the Combobox/Dropdown trigger gains focus, but before it is opened. This causes a minor difference in when
aria-activedescendant
is set, but does not cause any practical drawbacks to screen reader users. Some early ARIA combobox pattern work was based around the idea thataria-activedescendant
would always be set, so screen readers already handle logic on whether to read the activedescendant based onaria-expanded
.