File tree Expand file tree Collapse file tree 6 files changed +10
-6
lines changed Expand file tree Collapse file tree 6 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
10
10
### Fixed
11
11
12
12
- Ensure we handle ` null ` dataRef values correctly ([ #2258 ] ( https://github.com/tailwindlabs/headlessui/pull/2258 ) )
13
+ - Move ` aria-multiselectable ` to ` [role=listbox] ` in the ` Combobox ` component ([ #2271 ] ( https://github.com/tailwindlabs/headlessui/pull/2271 ) )
13
14
14
15
## [ 1.7.10] - 2023-02-06
15
16
Original file line number Diff line number Diff line change @@ -938,7 +938,6 @@ let Input = forwardRefWithAs(function Input<
938
938
'aria-expanded' : data . disabled ? undefined : data . comboboxState === ComboboxState . Open ,
939
939
'aria-activedescendant' :
940
940
data . activeOptionIndex === null ? undefined : data . options [ data . activeOptionIndex ] ?. id ,
941
- 'aria-multiselectable' : data . mode === ValueMode . Multi ? true : undefined ,
942
941
'aria-labelledby' : labelledby ,
943
942
'aria-autocomplete' : 'list' ,
944
943
defaultValue :
@@ -1186,6 +1185,7 @@ let Options = forwardRefWithAs(function Options<
1186
1185
let ourProps = {
1187
1186
'aria-labelledby' : labelledby ,
1188
1187
role : 'listbox' ,
1188
+ 'aria-multiselectable' : data . mode === ValueMode . Multi ? true : undefined ,
1189
1189
id,
1190
1190
ref : optionsRef ,
1191
1191
}
Original file line number Diff line number Diff line change @@ -281,7 +281,8 @@ export function assertCombobox(
281
281
state : ComboboxState
282
282
mode ?: ComboboxMode
283
283
} ,
284
- combobox = getComboboxInput ( )
284
+ combobox = getComboboxInput ( ) ,
285
+ listbox = getListbox ( )
285
286
) {
286
287
try {
287
288
switch ( options . state ) {
@@ -307,7 +308,7 @@ export function assertCombobox(
307
308
expect ( combobox ) . toHaveAttribute ( 'role' , 'combobox' )
308
309
309
310
if ( options . mode && options . mode === ComboboxMode . Multiple ) {
310
- expect ( combobox ) . toHaveAttribute ( 'aria-multiselectable' , 'true' )
311
+ expect ( listbox ) . toHaveAttribute ( 'aria-multiselectable' , 'true' )
311
312
}
312
313
313
314
if ( options . textContent ) expect ( combobox ) . toHaveTextContent ( options . textContent )
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
10
10
### Fixed
11
11
12
12
- Don’t fire ` afterLeave ` event more than once for a given transition ([ #2267 ] ( https://github.com/tailwindlabs/headlessui/pull/2267 ) )
13
+ - Move ` aria-multiselectable ` to ` [role=listbox] ` in the ` Combobox ` component ([ #2271 ] ( https://github.com/tailwindlabs/headlessui/pull/2271 ) )
13
14
14
15
## [ 1.7.9] - 2023-02-03
15
16
Original file line number Diff line number Diff line change @@ -907,7 +907,6 @@ export let ComboboxInput = defineComponent({
907
907
api . activeOptionIndex . value === null
908
908
? undefined
909
909
: api . options . value [ api . activeOptionIndex . value ] ?. id ,
910
- 'aria-multiselectable' : api . mode . value === ValueMode . Multi ? true : undefined ,
911
910
'aria-labelledby' : dom ( api . labelRef ) ?. id ?? dom ( api . buttonRef ) ?. id ,
912
911
'aria-autocomplete' : 'list' ,
913
912
id,
@@ -990,6 +989,7 @@ export let ComboboxOptions = defineComponent({
990
989
id,
991
990
ref : api . optionsRef ,
992
991
role : 'listbox' ,
992
+ 'aria-multiselectable' : api . mode . value === ValueMode . Multi ? true : undefined ,
993
993
}
994
994
let theirProps = omit ( props , [ 'hold' ] )
995
995
Original file line number Diff line number Diff line change @@ -281,7 +281,8 @@ export function assertCombobox(
281
281
state : ComboboxState
282
282
mode ?: ComboboxMode
283
283
} ,
284
- combobox = getComboboxInput ( )
284
+ combobox = getComboboxInput ( ) ,
285
+ listbox = getListbox ( )
285
286
) {
286
287
try {
287
288
switch ( options . state ) {
@@ -307,7 +308,7 @@ export function assertCombobox(
307
308
expect ( combobox ) . toHaveAttribute ( 'role' , 'combobox' )
308
309
309
310
if ( options . mode && options . mode === ComboboxMode . Multiple ) {
310
- expect ( combobox ) . toHaveAttribute ( 'aria-multiselectable' , 'true' )
311
+ expect ( listbox ) . toHaveAttribute ( 'aria-multiselectable' , 'true' )
311
312
}
312
313
313
314
if ( options . textContent ) expect ( combobox ) . toHaveTextContent ( options . textContent )
You can’t perform that action at this time.
0 commit comments