Skip to content

Commit

Permalink
Block supports: show selected item in font family select control (#68254
Browse files Browse the repository at this point in the history
)

Co-authored-by: ramonjd <[email protected]>
Co-authored-by: talldan <[email protected]>
  • Loading branch information
3 people authored Dec 24, 2024
1 parent 603a41f commit 23c6b88
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/block-editor/src/components/font-family/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,14 @@ export default function FontFamilyControl( {
);
}

const selectedValue =
options.find( ( option ) => option.key === value ) ?? '';
return (
<CustomSelectControl
__next40pxDefaultSize={ __next40pxDefaultSize }
__shouldNotWarnDeprecated36pxSize
label={ __( 'Font' ) }
value={ value }
value={ selectedValue }
onChange={ ( { selectedItem } ) => onChange( selectedItem.key ) }
options={ options }
className={ clsx( 'block-editor-font-family-control', className, {
Expand Down

1 comment on commit 23c6b88

@github-actions
Copy link

Choose a reason for hiding this comment

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

Flaky tests detected in 23c6b88.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12475170473
📝 Reported issues:

Please sign in to comment.