@@ -736,26 +736,18 @@ export const MultiSelect = React.forwardRef<MultiSelectRef, MultiSelectProps>(
736736 ) ;
737737 } , [ options , searchValue , searchable , isGroupedOptions ] ) ;
738738
739- const hasFilteredResults = React . useMemo ( ( ) => {
740- if ( isGroupedOptions ( filteredOptions ) ) {
741- return filteredOptions . some ( ( group ) => group . options . length > 0 ) ;
742- }
743- return filteredOptions . length > 0 ;
744- } , [ filteredOptions , isGroupedOptions ] ) ;
739+ const hasFilteredResults = isGroupedOptions ( filteredOptions )
740+ ? filteredOptions . some ( ( group ) => group . options . length > 0 )
741+ : filteredOptions . length > 0 ;
745742
746- const filteredOptionValues = React . useMemo ( ( ) => {
747- if ( isGroupedOptions ( filteredOptions ) ) {
748- return filteredOptions . flatMap ( ( group ) =>
743+ const filteredOptionValues = isGroupedOptions ( filteredOptions )
744+ ? filteredOptions . flatMap ( ( group ) =>
749745 group . options . map ( ( option ) => option . value ) ,
750- ) ;
751- }
752- return filteredOptions . map ( ( option ) => option . value ) ;
753- } , [ filteredOptions , isGroupedOptions ] ) ;
746+ )
747+ : filteredOptions . map ( ( option ) => option . value ) ;
754748
755- const hasSelectedInFiltered = React . useMemo (
756- ( ) =>
757- filteredOptionValues . some ( ( value ) => selectedValues . includes ( value ) ) ,
758- [ filteredOptionValues , selectedValues ] ,
749+ const hasSelectedInFiltered = filteredOptionValues . some ( ( value ) =>
750+ selectedValues . includes ( value ) ,
759751 ) ;
760752
761753 const handleInputKeyDown = (
0 commit comments