@@ -43,7 +43,7 @@ const getLastOptionIndex = (options, filteredOptions, searchable, optional, mult
4343 let last = 0 ;
4444 const reducer = ( acc , current ) => acc + current . options ?. length ;
4545
46- if ( searchable && filteredOptions . length > 0 )
46+ if ( searchable && filteredOptions ? .length > 0 )
4747 filteredOptions [ 0 ] . options ? ( last = filteredOptions . reduce ( reducer , 0 ) - 1 ) : ( last = filteredOptions . length - 1 ) ;
4848 else if ( options ?. length > 0 )
4949 options [ 0 ] . options ? ( last = options . reduce ( reducer , 0 ) - 1 ) : ( last = options . length - 1 ) ;
@@ -58,11 +58,11 @@ const getSelectedOption = (value, options, multiple, optional, optionalItem) =>
5858 if ( multiple ) {
5959 if ( options ?. length > 0 ) {
6060 options . forEach ( ( option ) => {
61- if ( option . options ) {
61+ if ( option . options )
6262 option . options . forEach ( ( singleOption ) => {
6363 if ( value . includes ( singleOption . value ) && Array . isArray ( selectedOption ) ) selectedOption . push ( singleOption ) ;
6464 } ) ;
65- } else if ( value . includes ( option . value ) && Array . isArray ( selectedOption ) ) selectedOption . push ( option ) ;
65+ else if ( value . includes ( option . value ) && Array . isArray ( selectedOption ) ) selectedOption . push ( option ) ;
6666 } ) ;
6767 }
6868 } else {
@@ -211,7 +211,7 @@ const DxcSelect = React.forwardRef<RefType, SelectPropsType>(
211211 if ( ! event . currentTarget . contains ( event . relatedTarget ) ) searchable && selectSearchInputRef . current . focus ( ) ;
212212 } ;
213213 const handleSelectOnBlur = ( event ) => {
214- // focus leaves container (outside, not to childs )
214+ // focus leaves container (outside, not to child )
215215 if ( ! event . currentTarget . contains ( event . relatedTarget ) ) {
216216 closeOptions ( ) ;
217217 setSearchValue ( "" ) ;
0 commit comments