-
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
Background Image block support: Add reset menu item #54341
Background Image block support: Add reset menu item #54341
Conversation
Size Change: +26 B (0%) Total Size: 1.52 MB
ℹ️ View Unchanged
|
Flaky tests detected in 2e4f293. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/6142755752
|
@andrewserong how would this reset action interact with a background image inherited from global styles? If it is effectively applying |
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.
Thanks for taking a look, folks!
This PR just clears out the local background-image (if set), without outputting any styles. If and when we introduce background images in global styles, hitting Reset on a local-to-the-block background image will clear out the local image while allowing the global styles image (when we eventually add that behaviour) to be revealed. So, for the scope of this PR, there is no |
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.
Seems good to go :)
Thanks folks! 🙇 |
What?
Fixes #54319
Add a
Reset
menu item to the background image block support's replace media control.Why?
As raised in #54319 while the background image can be reset by the tools panel's dropdown menu, since the replace button displays a list of options, it'd be good for it to include
Reset
here, too, for discoverability.How?
Add a
MenuItem
to the use ofMediaReplaceFlow
to render aReset
button that clears out the background image.Testing Instructions
Testing Instructions for Keyboard
As above, but you should be able to tab over to the image button in the block inspector, press Enter, and then use arrow keys to reach the Reset button and then press Enter to clear the background image.
Screenshots or screencast
Screengrab:
2023-09-11.16.07.23.mp4