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

CustomSelectControl: Update Value from Fresh State #67733

Merged
merged 6 commits into from
Dec 10, 2024
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 @@ -45,6 +45,7 @@
### Bug Fixes

- `ResizableBox`: Make drag handles focusable ([#67305](https://github.com/WordPress/gutenberg/pull/67305)).
- `CustomSelectControl`: Update correctly when `showSelectedHint` is enabled ([#67733](https://github.com/WordPress/gutenberg/pull/67733)).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tweaked the text a bit so it describes the change to any consumer of this component, not a user of the Gutenberg app.


## 28.13.0 (2024-11-27)

Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/custom-select-control/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ function CustomSelectControl< T extends CustomSelectOption >(
const renderSelectedValueHint = () => {
const selectedOptionHint = options
?.map( applyOptionDeprecations )
?.find( ( { name } ) => currentValue === name )?.hint;
?.find( ( { name } ) => store.getState().value === name )?.hint;

return (
<Styled.SelectedExperimentalHintWrapper>
{ currentValue }
{ store.getState().value }
{ selectedOptionHint && (
<Styled.SelectedExperimentalHintItem
// Keeping the classname for legacy reasons
Expand Down
Loading