Skip to content

Commit

Permalink
Create block on focus on the empty post placeholder
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Nov 24, 2021
1 parent 786f0d2 commit c4f0c07
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Expand Up @@ -59,6 +59,11 @@ export function DefaultBlockAppender( {
}
} }
onClick={ () => onAppend() }
onFocus={ () => {
if ( showPrompt ) {
onAppend();
}
} }
>
{ showPrompt ? value : ZWNBSP }
</p>
Expand Down
Expand Up @@ -9,6 +9,7 @@ exports[`DefaultBlockAppender should append a default block when input focused 1
aria-label="Add default block"
className="block-editor-default-block-appender__content"
onClick={[Function]}
onFocus={[Function]}
onKeyDown={[Function]}
role="button"
tabIndex="0"
Expand All @@ -32,6 +33,7 @@ exports[`DefaultBlockAppender should match snapshot 1`] = `
aria-label="Add default block"
className="block-editor-default-block-appender__content"
onClick={[Function]}
onFocus={[Function]}
onKeyDown={[Function]}
role="button"
tabIndex="0"
Expand All @@ -55,6 +57,7 @@ exports[`DefaultBlockAppender should optionally show without prompt 1`] = `
aria-label="Add default block"
className="block-editor-default-block-appender__content"
onClick={[Function]}
onFocus={[Function]}
onKeyDown={[Function]}
role="button"
tabIndex="0"
Expand Down

0 comments on commit c4f0c07

Please sign in to comment.