Skip to content

Commit

Permalink
Give priority to showSelectedHint over `__experimentalShowSelectedH…
Browse files Browse the repository at this point in the history
…int`
  • Loading branch information
ciampo committed Jul 10, 2024
1 parent d0d3f8d commit 7ba4435
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ import type { LegacyCustomSelectProps } from '../types';
import * as Styled from '../styles';

function useDeprecatedProps( {
showSelectedHint = false,
options,
// Deprecated
__experimentalShowSelectedHint,
...otherProps
}: LegacyCustomSelectProps ) {
return {
showSelectedHint: __experimentalShowSelectedHint,
...otherProps,
options: options.map( ( o ) => {
const toReturn = o;
Expand All @@ -35,10 +35,6 @@ function useDeprecatedProps( {

return toReturn;
} ),
showSelectedHint:
typeof __experimentalShowSelectedHint !== 'undefined'
? __experimentalShowSelectedHint
: showSelectedHint,
};
}

Expand All @@ -51,7 +47,7 @@ function CustomSelectControl( props: LegacyCustomSelectProps ) {
size = 'default',
value,
className: classNameProp,
showSelectedHint,
showSelectedHint = false,
...restProps
} = useDeprecatedProps( props );

Expand Down

0 comments on commit 7ba4435

Please sign in to comment.