Skip to content

Commit

Permalink
Fix big with value not being passed by onBlur method
Browse files Browse the repository at this point in the history
  • Loading branch information
glendaviesnz committed Jan 25, 2023
1 parent 226002e commit 4c24d08
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions packages/edit-site/src/components/global-styles/custom-css.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,19 @@ function CustomCSSControl( { blockName } ) {
}
}

function handleOnBlur( value ) {
const [ transformed ] = transformStyles(
[ { css: value } ],
'.editor-styles-wrapper'
);
setCSSError(
transformed === null ? __( 'Error while parsing the CSS.' ) : null
);
function handleOnBlur( event ) {
if ( event?.target?.value ) {
const [ transformed ] = transformStyles(
[ { css: event.target.value } ],
'.editor-styles-wrapper'
);

setCSSError(
transformed === null
? __( 'Error while parsing the CSS.' )
: null
);
}
}

const originalThemeCustomCSS =
Expand Down

0 comments on commit 4c24d08

Please sign in to comment.