Skip to content
Closed
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
10 changes: 5 additions & 5 deletions packages/block-editor/src/hooks/fit-text.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ function useFitText( { fitText, name, clientId } ) {
*/
export function FitTextControl( {
clientId,
fitText = false,
fitText,
setAttributes,
name,
fontSize,
Expand All @@ -256,17 +256,17 @@ export function FitTextControl( {
return (
<InspectorControls group="typography">
<ToolsPanelItem
hasValue={ () => fitText }
hasValue={ () => fitText === true || fitText === false }
label={ __( 'Fit text' ) }
onDeselect={ () => setAttributes( { fitText: undefined } ) }
resetAllFilter={ () => ( { fitText: undefined } ) }
panelId={ clientId }
>
<ToggleControl
label={ __( 'Fit text' ) }
checked={ fitText }
checked={ fitText === true }
onChange={ () => {
const newFitText = ! fitText || undefined;
const newFitText = fitText ? false : true;
const updates = { fitText: newFitText };

// When enabling fit text, clear font size if it has a value
Expand All @@ -288,7 +288,7 @@ export function FitTextControl( {
setAttributes( updates );
} }
help={
fitText
fitText === true
? __( 'Text will resize to fit its container.' )
: __(
'The text will resize to fit its container, resetting other font size settings.'
Expand Down
Loading