Skip to content

Commit

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

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

0 comments on commit 23c6b88

Please sign in to comment.