@@ -139,8 +139,7 @@ const findHighlightedIndex = <ItemType,>(
139139
140140 for ( let i = 0 ; i < items . length ; i ++ ) {
141141 const item = itemToString ( items [ i ] ) . toLowerCase ( ) ;
142- // TODO: Use `isDisabledItem`.
143- if ( ! items [ i ] [ 'disabled' ] && item . indexOf ( searchValue ) !== - 1 ) {
142+ if ( ! isDisabledItem ( items [ i ] ) && item . indexOf ( searchValue ) !== - 1 ) {
144143 return i ;
145144 }
146145 }
@@ -679,9 +678,7 @@ const ComboBox = forwardRef(
679678 ) ;
680679 const highlightedItem = filteredList [ state . highlightedIndex ] ;
681680
682- // TODO: Use `isDisabledItem`.
683- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
684- if ( highlightedItem && ! ( highlightedItem as any ) . disabled ) {
681+ if ( highlightedItem && ! isDisabledItem ( highlightedItem ) ) {
685682 return {
686683 ...changes ,
687684 selectedItem : highlightedItem ,
@@ -693,9 +690,7 @@ const ComboBox = forwardRef(
693690 if ( autoIndex !== - 1 ) {
694691 const matchingItem = items [ autoIndex ] ;
695692
696- // TODO: Use `isDisabledItem`.
697- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
698- if ( matchingItem && ! ( matchingItem as any ) . disabled ) {
693+ if ( matchingItem && ! isDisabledItem ( matchingItem ) ) {
699694 return {
700695 ...changes ,
701696 selectedItem : matchingItem ,
@@ -883,11 +878,7 @@ const ComboBox = forwardRef(
883878 initialSelectedItem : initialSelectedItem ,
884879 inputId : id ,
885880 stateReducer,
886- isItemDisabled ( item ) {
887- // TODO: Use `isDisabledItem`.
888- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
889- return ( item as any ) ?. disabled ;
890- } ,
881+ isItemDisabled : isDisabledItem ,
891882 ...downshiftProps ,
892883 onStateChange : ( { type, selectedItem : newSelectedItem } ) => {
893884 downshiftProps ?. onStateChange ?.( {
0 commit comments