-
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
Block Settings: Only display parent block selector on small screens #56431
Conversation
Size Change: +33 B (0%) Total Size: 1.7 MB
ℹ️ View Unchanged
|
// Allows highlighting the parent block outline when focusing or hovering | ||
// the parent block selector within the child. | ||
const menuItemRef = useRef(); | ||
const gesturesProps = useShowHoveredOrFocusedGestures( { |
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.
When would this be triggered on a touch screen?
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've not tested on touch screens, but it should highlight the block when a menu item is hovered or focused.
I just changed variable names; the functionality is the same.
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.
This makes sense otherwise on mobile it's hard to go up to parent in the visual editor w/o list view being invoked, which also hides the content.
Just noting that once #52032 is wrapped we can remove the select parent from this menu on mobile as well, b/c then the parent selector will live in the block toolbar.
Very nice! |
What?
Alternative to #50443.
PR updates rendering logic for parent selector menu item in the Block Options dropdown. Now it's only rendered when the toolbar button with the same functionality isn't displayed - on small screens.
Now it's only rendered on smaller screens when the parent selector in the Block Toolbar isn't visible.
Why?
See discussion in #50443.
How?
I've moved most of the logic into the
ParentSelectorMenuItem
component, which will bail out rendering based on the screen size.Testing Instructions
Testing Instructions for Keyboard
Same.
Screenshots or screencast
CleanShot.2023-11-22.at.15.21.53.mp4