-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
add/3016: Automatically select the upload image button on image blk focus #3142
Conversation
@jasmussen is this change what you were after in #3016 ? |
Codecov Report
@@ Coverage Diff @@
## master #3142 +/- ##
==========================================
- Coverage 31.67% 31.55% -0.12%
==========================================
Files 217 217
Lines 6261 6284 +23
Branches 1112 1120 +8
==========================================
Hits 1983 1983
- Misses 3598 3613 +15
- Partials 680 688 +8
Continue to review full report at Codecov.
|
I like this behavior a lot. Is it kosher, @afercia? |
Not clear to me, I don't see a button getting focus when a block is focused. I'm probably missing something 🙂
Should be tested a bit with other combos; quickly testing just in Safari+VoiceOver the block type information gets announced in both cases, and this is important to give users a clue where they've just landed: before: after: However, I have a couple usability concerns: 1
Overall, I think setting initial focus is often a developers assumption based on just one specific workflow. But this is just my personal opinion 🙂 2 Aside: the text |
You make some good points Andrea. Alternately, the placeholder block needs a big focus style, which it doesn't appear to have now. |
The button will be focused if the focus prop is set on the block and nothing within the block is already the active element (as per document.activeElement ). So typically the block only gets focused like this when it is newly created. Technically I am not specifically choosing the button to be focused but just picking the first tabbable within the block. |
@jasmussen I'm not clear on what I should do next. Should I?...
@afercia Does your advice relate to the other blocks that are mentioned in #3016 - for example I also made a similar change for the code block on the branch add/3016-auto-focus-code-block in that case there is nothing else to focus but the codeblock so would that one be ok? |
I think for now, this exploration should probably be left as is. No reason to close the PR, but let's let it sit here as we explore focus improvements first. The key use case I was hoping to address with this change was the following text flow: That is — when using the slash command to insert, focus was already on the buttons, because that felt natural. However Andreas points about being able to also focus the blocks make a lot of sense. So I'm going to explore separately a tab focus style for blocks. |
Chatted with Morgan in Slack about steps to reproduce the edgecase, here are steps and a GIF:
GIF: It will only happen when the selection started on the last line, because when pressing down, it checks the end of your selection. From Morgan on whether this is fixable:
I feel like it's worth getting this branch into master before it grows more. Then we can track and fix this issue separately. Thoughts, @mtias, @aduth ? |
Well not only those. For example, what about initial focus on blocks like pullquote, shortcode, video, audio... My point was more about the fact there's a great variety of blocks. They often have different controls (editable, other fields, buttons). Custom blocks added by plugins may have a completely different UI. What would be the most predictable initial focus mechanism for users? This should probably be standardized in a way both built-in and custom blocks have the same behavior. One more important consideration is that custom block authors shouldn't worry about focus management. Gutenberg should handle focus for them. |
@jasmussen I think your comment above (#3142 (comment)) is in the wrong issue :) Either way, it was merged as part of #3038 |
Ok, I will shelve this issue (and the related PRs that I was working on) until focus and multi-block selection is finalized. |
@jasmussen @afercia Is this still relevant / actionable? |
No, I think it's superceded by some work @aduth is looking into. Thanks. |
Related issue: #6687 |
Description
Like editable automatically focus a relevant button when the block is focused. If this direction is acceptable a similar approach can be used on the other blocks mentioned in #3016 .
How Has This Been Tested?
Currently only manually tested in Firefox on linux.
Screenshots (jpeg or gifs if applicable):
TODO
Types of changes
New feature
Checklist: