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.
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
Fix multiple tooltips showing on NavigableToolbars #49644
Fix multiple tooltips showing on NavigableToolbars #49644
Changes from all commits
820035d
2c99327
3db06db
87eabd8
b7e3091
9222cc6
d4ed2ba
c05a396
3146b4e
ec44ad5
c201962
964d06d
8050ffb
a65fd0a
02cfb03
abeb991
26d79a2
a4c4633
29ccd55
f51fb72
6bfb00f
766ef57
9657c9d
82784d6
aede555
21deaa2
47c6561
3eef424
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Is there a similar thing going on in
edit-site
too? What is the advantage of usinguseShouldContextualToolbarShow
here instead of leaving all the conditions inlined where they were and just looking at( ( hasFixedToolbar || ! isLargeViewport ) && selectedBlockId )
here?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.
There was a lot of conditions in the block toolbar and @ajlende pointed out that we might be missing some conditions. For example, my conditions didn't account for smaller viewports. The way to be sure we weren't sending focus to the top toolbar was to use all the same conditions as we are for the block toolbar. That's why we decided to consolidate them.
All that said, I don't have a strong preference. I do like this hook though. It can be very useful for knowing if the block toolbar should be showing or if it will be focusable from a keyboard shortcut anywhere else in Gutenberg.
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.
Having the hook means that we know it will be the same in both places which is what we want. From previous experience, if you don't do things this way in gutenberg, someone is going to update the condition in one place and miss the other place.