@@ -140,17 +140,6 @@ export interface ComboboxControllerOptions<Item extends HTMLElement> extends
140140 * By default, toggles the `hidden` attribute on the item
141141 */
142142 setItemHidden ?( item : Item , hidden : boolean ) : void ;
143- /**
144- * Optional. When provided, passed to ListboxController so it does not set
145- * aria-setsize/aria-posinset on items.
146- */
147- setItems ?( items : Item [ ] ) : void ;
148- /**
149- * Optional. Returns position-in-set and set size for the focused item when
150- * building the Safari VoiceOver live-region announcement ("N of M").
151- * When not provided, the controller reads aria-posinset/aria-setsize from the item.
152- */
153- getItemPosition ?( item : Item , items : Item [ ] ) : { posInSet : number ; setSize : number } | null ;
154143}
155144
156145/**
@@ -363,7 +352,6 @@ export class ComboboxController<
363352 getATFocusedItem : ( ) => this . items [ this . #fc?. atFocusedItemIndex ?? - 1 ] ?? null ,
364353 isItemDisabled : this . options . isItemDisabled ,
365354 setItemSelected : this . options . setItemSelected ,
366- setItems : this . options . setItems ,
367355 } ) ;
368356 ComboboxController . instances . set ( host , this ) ;
369357 ComboboxController . hosts . add ( host ) ;
@@ -563,21 +551,11 @@ export class ComboboxController<
563551 if ( this . #lb. isSelected ( item ) ) {
564552 text += `, (${ this . #translate( 'selected' , langKey ) } )` ;
565553 }
566- const position =
567- typeof this . options . getItemPosition === 'function' ?
568- this . options . getItemPosition ( item , this . items )
569- : null ;
570- const posInSet =
571- position ?. posInSet
572- ?? ( item . hasAttribute ( 'aria-posinset' ) ? item . getAttribute ( 'aria-posinset' ) : null ) ;
573- const setSize =
574- position ?. setSize
575- ?? ( item . hasAttribute ( 'aria-setsize' ) ? item . getAttribute ( 'aria-setsize' ) : null ) ;
576- if ( posInSet != null && setSize != null ) {
554+ if ( item . hasAttribute ( 'aria-setsize' ) && item . hasAttribute ( 'aria-posinset' ) ) {
577555 if ( langKey === 'ja' ) {
578- text += `, (${ setSize } 件中 ${ posInSet } 件目)` ;
556+ text += `, (${ item . getAttribute ( 'aria-setsize' ) } 件中 ${ item . getAttribute ( 'aria-posinset' ) } 件目)` ;
579557 } else {
580- text += `, (${ posInSet } ${ this . #translate( 'of' , langKey ) } ${ setSize } )` ;
558+ text += `, (${ item . getAttribute ( 'aria-posinset' ) } ${ this . #translate( 'of' , langKey ) } ${ item . getAttribute ( 'aria-setsize' ) } )` ;
581559 }
582560 }
583561 ComboboxController . #alert. lang = lang ;
0 commit comments