Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Components: mark CustomSelectControl hint option as experimental #35673

Merged
merged 5 commits into from
Oct 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

- Removed the `fieldset` wrapper from the `FontAppearanceControl` component ([35461](https://github.com/WordPress/gutenberg/pull/35461)).
- Refactored the `ToggleGroupControl` component's structure and embedded `ToggleGroupControlButton` directly into `ToggleGroupControlOption` ([#35600](https://github.com/WordPress/gutenberg/pull/35600)).
- Added support for showing an experimental hint in `CustomSelectControl` ([#35673](https://github.com/WordPress/gutenberg/pull/35673)).

### Breaking Changes

Expand Down
6 changes: 3 additions & 3 deletions packages/components/src/custom-select-control/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,16 @@ export default function CustomSelectControl( {
{
'is-highlighted':
index === highlightedIndex,
'has-hint': !! item.hint,
'has-hint': !! item.__experimentalHint,
}
),
style: item.style,
} ) }
>
{ item.name }
{ item.hint && (
{ item.__experimentalHint && (
<span className="components-custom-select-control__item-hint">
{ item.hint }
{ item.__experimentalHint }
</span>
) }
{ item === selectedItem && (
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/font-size-picker/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ function getSelectOptions( optionsArray, disableCustomFontSizes ) {
key: slug,
name,
size,
hint: size && isSimpleCssValue( size ) && parseInt( size ),
__experimentalHint:
size && isSimpleCssValue( size ) && parseInt( size ),
} ) );
}

Expand Down