@@ -25,15 +25,15 @@ const canOpenOptions = (options: Option[] | OptionGroup[], disabled: boolean) =>
2525
2626const filterOptionsBySearchValue = (
2727 options : Option [ ] | OptionGroup [ ] ,
28- searchValue : string
28+ searchValue : string ,
2929) : Option [ ] | OptionGroup [ ] => {
3030 if ( options ?. length > 0 ) {
3131 if ( isArrayOfOptionGroups ( options ) )
3232 return options . map ( ( optionGroup ) => {
3333 const group = {
3434 label : optionGroup . label ,
3535 options : optionGroup . options . filter ( ( option ) =>
36- option . label . toUpperCase ( ) . includes ( searchValue . toUpperCase ( ) )
36+ option . label . toUpperCase ( ) . includes ( searchValue . toUpperCase ( ) ) ,
3737 ) ,
3838 } ;
3939 return group ;
@@ -47,7 +47,7 @@ const getLastOptionIndex = (
4747 filteredOptions : Option [ ] | OptionGroup [ ] ,
4848 searchable : boolean ,
4949 optional : boolean ,
50- multiple : boolean
50+ multiple : boolean ,
5151) => {
5252 let last = 0 ;
5353 const reducer = ( acc : number , current : OptionGroup ) => acc + current . options ?. length ;
@@ -67,7 +67,7 @@ const getSelectedOption = (
6767 options : Option [ ] | OptionGroup [ ] ,
6868 multiple : boolean ,
6969 optional : boolean ,
70- optionalItem : Option
70+ optionalItem : Option ,
7171) => {
7272 let selectedOption : Option | Option [ ] = multiple ? [ ] : ( { } as Option ) ;
7373 let singleSelectionIndex : number ;
@@ -164,7 +164,7 @@ const DxcSelect = React.forwardRef<RefType, SelectPropsType>(
164164 size = "medium" ,
165165 tabIndex = 0 ,
166166 } ,
167- ref
167+ ref ,
168168 ) : JSX . Element => {
169169 const selectId = `select-${ useId ( ) } ` ;
170170 const selectLabelId = `label-${ selectId } ` ;
@@ -188,11 +188,11 @@ const DxcSelect = React.forwardRef<RefType, SelectPropsType>(
188188 const filteredOptions = useMemo ( ( ) => filterOptionsBySearchValue ( options , searchValue ) , [ options , searchValue ] ) ;
189189 const lastOptionIndex = useMemo (
190190 ( ) => getLastOptionIndex ( options , filteredOptions , searchable , optional , multiple ) ,
191- [ options , filteredOptions , searchable , optional , multiple ]
191+ [ options , filteredOptions , searchable , optional , multiple ] ,
192192 ) ;
193193 const { selectedOption, singleSelectionIndex } = useMemo (
194194 ( ) => getSelectedOption ( value ?? innerValue , options , multiple , optional , optionalItem ) ,
195- [ value , innerValue , options , multiple , optional , optionalItem ]
195+ [ value , innerValue , options , multiple , optional , optionalItem ] ,
196196 ) ;
197197
198198 const openOptions = ( ) => {
@@ -275,7 +275,7 @@ const DxcSelect = React.forwardRef<RefType, SelectPropsType>(
275275 ( ! isOpen || ( visualFocusIndex === - 1 && singleSelectionIndex > - 1 && singleSelectionIndex <= lastOptionIndex ) )
276276 ? changeVisualFocusIndex ( singleSelectionIndex )
277277 : changeVisualFocusIndex ( ( visualFocusIndex ) =>
278- visualFocusIndex === 0 || visualFocusIndex === - 1 ? lastOptionIndex : visualFocusIndex - 1
278+ visualFocusIndex === 0 || visualFocusIndex === - 1 ? lastOptionIndex : visualFocusIndex - 1 ,
279279 ) ;
280280 openOptions ( ) ;
281281 break ;
@@ -350,7 +350,7 @@ const DxcSelect = React.forwardRef<RefType, SelectPropsType>(
350350 ! multiple && closeOptions ( ) ;
351351 setSearchValue ( "" ) ;
352352 } ,
353- [ handleSelectChangeValue , closeOptions , multiple ]
353+ [ handleSelectChangeValue , closeOptions , multiple ] ,
354354 ) ;
355355
356356 useEffect ( ( ) => {
@@ -521,7 +521,7 @@ const DxcSelect = React.forwardRef<RefType, SelectPropsType>(
521521 </ SelectContainer >
522522 </ ThemeProvider >
523523 ) ;
524- }
524+ } ,
525525) ;
526526
527527const sizes = {
@@ -542,6 +542,7 @@ const SelectContainer = styled.div<{ margin: SelectPropsType["margin"]; size: Se
542542 box-sizing: border-box;
543543
544544 width: ${ ( props ) => calculateWidth ( props . margin , props . size ) } ;
545+ ${ ( props ) => props . size !== "fillParent" && "min-width:" + calculateWidth ( props . margin , props . size ) } ;
545546 margin: ${ ( props ) => ( props . margin && typeof props . margin !== "object" ? spaces [ props . margin ] : "0px" ) } ;
546547 margin-top: ${ ( props ) =>
547548 props . margin && typeof props . margin === "object" && props . margin . top ? spaces [ props . margin . top ] : "" } ;
0 commit comments