-
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
Audio Block: Refactor setting panel to use ToolsPanel #69324
base: trunk
Are you sure you want to change the base?
Audio Block: Refactor setting panel to use ToolsPanel #69324
Conversation
refactor-audio-block-control-panel
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
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.
Resetting the options to false and undefined looks correct to me.
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.
LGTM!
Although not directly related to the purpose of this PR, can you fix the following browser console error? This error occurs the first time you insert a block, apply media, and enable "Autoplay" or "Loop":
diff --git a/packages/block-library/src/audio/edit.js b/packages/block-library/src/audio/edit.js
index 47e73b4ea7..5b2737873f 100644
--- a/packages/block-library/src/audio/edit.js
+++ b/packages/block-library/src/audio/edit.js
@@ -190,7 +190,7 @@ function AudioEdit( {
__nextHasNoMarginBottom
label={ __( 'Autoplay' ) }
onChange={ toggleAttribute( 'autoplay' ) }
- checked={ autoplay }
+ checked={ !! autoplay }
help={ getAutoplayHelp }
/>
</ToolsPanelItem>
@@ -208,7 +208,7 @@ function AudioEdit( {
__nextHasNoMarginBottom
label={ __( 'Loop' ) }
onChange={ toggleAttribute( 'loop' ) }
- checked={ loop }
+ checked={ !! loop }
/>
</ToolsPanelItem>
<ToolsPanelItem
9e253326d8c23852e0da379bcc1fc0e1.mp4
Thanks for the review |
Note: The currently failing E2E tests are not caused by this PR. See https://core.trac.wordpress.org/ticket/56481#comment:45 Once this issue is resolved, let's run the E2E tests again. |
What?
Part of #67813
Make the settings panel more consistent with other blocks
Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
audio-block.mp4