diff --git a/packages/format-library/src/underline/index.js b/packages/format-library/src/underline/index.js index 90d7c5852214e3..6973a44ec46695 100644 --- a/packages/format-library/src/underline/index.js +++ b/packages/format-library/src/underline/index.js @@ -5,8 +5,10 @@ import { __ } from '@wordpress/i18n'; import { toggleFormat } from '@wordpress/rich-text'; import { RichTextShortcut, + RichTextToolbarButton, __unstableRichTextInputEvent, } from '@wordpress/block-editor'; +import { formatUnderline } from '@wordpress/icons'; const name = 'core/underline'; const title = __( 'Underline' ); @@ -19,7 +21,7 @@ export const underline = { attributes: { style: 'style', }, - edit( { value, onChange } ) { + edit( { isActive, value, onChange, onFocus } ) { const onToggle = () => { onChange( toggleFormat( value, { @@ -30,6 +32,7 @@ export const underline = { title, } ) ); + onFocus(); }; return ( @@ -43,6 +46,13 @@ export const underline = { inputType="formatUnderline" onInput={ onToggle } /> + ); },