Skip to content

Commit

Permalink
Fix experimentalHint custom styling on legacy adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
fullofcaffeine committed May 17, 2024
1 parent 1c49502 commit 5818e1a
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
// eslint-disable-next-line no-restricted-imports
import * as Ariakit from '@ariakit/react';
import clsx from 'clsx';
/**
* WordPress dependencies
*/
Expand Down Expand Up @@ -65,9 +66,9 @@ function CustomSelectControl( props: LegacyCustomSelectProps ) {
}, [] );

const children = options.map(
( { name, key, __experimentalHint, ...rest } ) => {
( { name, key, __experimentalHint, className, ...rest } ) => {
const withHint = (
<Styled.WithHintWrapper>
<Styled.WithHintWrapper style={ { display: 'grid' } }>
<span>{ name }</span>
<Styled.ExperimentalHintItem className="components-custom-select-control__item-hint">
{ __experimentalHint }
Expand All @@ -80,6 +81,9 @@ function CustomSelectControl( props: LegacyCustomSelectProps ) {
key={ key }
value={ name }
children={ __experimentalHint ? withHint : name }
className={ clsx( className, {
'has-hint': __experimentalHint,
} ) }
{ ...rest }
/>
);
Expand Down

0 comments on commit 5818e1a

Please sign in to comment.