@@ -20,6 +20,7 @@ import {
2020 MenuPositionEnum ,
2121 FunctionDefaults ,
2222 EMPTY_ARRAY ,
23+ DEFAULT_THEME ,
2324 SELECT_WRAPPER_ATTRS ,
2425 PLACEHOLDER_DEFAULT ,
2526 LOADING_MSG_DEFAULT ,
@@ -34,7 +35,7 @@ import type { FixedSizeList } from 'react-window';
3435import styled , { css , ThemeProvider , type DefaultTheme } from 'styled-components' ;
3536import { Menu , Value , AriaLiveRegion , AutosizeInput , IndicatorIcons } from './components' ;
3637import { useDebounce , useCallbackRef , useMenuOptions , useMountEffect , useUpdateEffect , useMenuPositioner } from './hooks' ;
37- import { isBoolean , isFunction , mergeThemes , suppressEvent , normalizeValue , IS_TOUCH_DEVICE , isArrayWithLength } from './utils' ;
38+ import { isBoolean , isFunction , isPlainObject , mergeDeep , suppressEvent , normalizeValue , IS_TOUCH_DEVICE , isArrayWithLength } from './utils' ;
3839import type {
3940 Theme ,
4041 SelectRef ,
@@ -257,7 +258,11 @@ const Select = forwardRef<SelectRef, SelectProps>((
257258 const [ focusedOption , setFocusedOption ] = useState < FocusedOption > ( FOCUSED_OPTION_DEFAULT ) ;
258259
259260 // Memoized DefaultTheme object for styled-components ThemeProvider
260- const theme = useMemo < DefaultTheme > ( ( ) => mergeThemes ( themeConfig ) , [ themeConfig ] ) ;
261+ const theme = useMemo < DefaultTheme > ( ( ) => {
262+ return isPlainObject ( themeConfig )
263+ ? mergeDeep ( DEFAULT_THEME , themeConfig )
264+ : DEFAULT_THEME ;
265+ } , [ themeConfig ] ) ;
261266
262267 // Memoized callback functions referencing optional function properties on Select.tsx
263268 const getOptionLabelFn = useMemo < OptionLabelCallback > ( ( ) => getOptionLabel || FunctionDefaults . OPTION_LABEL , [ getOptionLabel ] ) ;
0 commit comments