Try adding focus outline for blocks that don't have input fields#3951
Merged
Try adding focus outline for blocks that don't have input fields#3951
Conversation
added 4 commits
December 8, 2017 12:23
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.
youknowriad
approved these changes
Dec 12, 2017
Contributor
youknowriad
left a comment
There was a problem hiding this comment.
I personally like this change, might be good to have a second opinion.
youknowriad
reviewed
Dec 12, 2017
|
|
||
| // 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 { |
Contributor
There was a problem hiding this comment.
Shouldn't this be moved to the editor/components/block-list/style.scss file? Thinking this style could be usefulll regardless of the layout.
Contributor
Author
3 tasks
karmatosed
approved these changes
Dec 13, 2017
Contributor
Author
|
🎉 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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.