diff --git a/packages/block-editor/src/hooks/fit-text.js b/packages/block-editor/src/hooks/fit-text.js index 91089eaaef2fc9..1890379e7e6053 100644 --- a/packages/block-editor/src/hooks/fit-text.js +++ b/packages/block-editor/src/hooks/fit-text.js @@ -243,7 +243,7 @@ function useFitText( { fitText, name, clientId } ) { */ export function FitTextControl( { clientId, - fitText = false, + fitText, setAttributes, name, fontSize, @@ -256,7 +256,7 @@ export function FitTextControl( { return ( fitText } + hasValue={ () => fitText === true || fitText === false } label={ __( 'Fit text' ) } onDeselect={ () => setAttributes( { fitText: undefined } ) } resetAllFilter={ () => ( { fitText: undefined } ) } @@ -264,9 +264,9 @@ export function FitTextControl( { > { - 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 @@ -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.'