-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Try adding focus outline for blocks that don't have input fields #3951
Conversation
This PR is an experiment to add a focus style for blocks have focus when using just the keyboard. It is experimental right now, but it could potentially provide a nicer editing flow, by showing what's selected when your caret disappears and a block is instead selected. Obviously when that happens you can press delete or backspace to remove said block, or you can press enter to make a linebreak.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally like this change, might be good to have a second opinion.
@@ -39,6 +39,14 @@ | |||
} | |||
} | |||
|
|||
// This is a focus style shown for blocks that need an indicator even when in an isEditing state | |||
// like for example an image block that receives arrowkey focus. | |||
.editor-visual-editor .editor-block-list__block:not( .is-selected ) .editor-block-list__block-edit:focus { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be moved to the editor/components/block-list/style.scss
file? Thinking this style could be usefulll regardless of the layout.
🎉 |
This probably fixes #3560 and maybe fixes #1829.
When you select a block, we show outlines for that block. When you then start writing, those outlines and all the controls fade out, letting you focus on the text. But when you then use arrowkey navigation to move between blocks and encounter a block that has no textfield, there's no indication what's selected. This is nicely illustrated in #3560.
This PR tries to address that, by showing an indicator on blocks that have no input fields. And so in absence of a caret cursor to indicate your place, there's now an outline:
In addition to highlighting your place in the block list, this is also useful in indicating that you can press Enter to make a linebreak, or press Delete or Backspace to delete the indicated block.