Skip to content

Audio: Apply inert directly instead of wrapping in Disabled#79423

Merged
Mamaduka merged 1 commit into
trunkfrom
update/audio-block-inert-prop
Jun 23, 2026
Merged

Audio: Apply inert directly instead of wrapping in Disabled#79423
Mamaduka merged 1 commit into
trunkfrom
update/audio-block-inert-prop

Conversation

@Mamaduka

Copy link
Copy Markdown
Member

What?

The Audio block's edit component wrapped the <audio> in a Disabled component to prevent playback when the block isn't selected. The only behavior needed here is inert, so apply it directly to the <audio> element instead.

This mirrors the same change made for the Video block in #79371.

Benefits:

  • Removes an extra DOM node, so editor markup matches the frontend (save) output: <figure> -> <audio>.
  • Drops the Disabled dependency and its unused styles/context for this block.

Testing Instructions

  1. Open a post or page.
  2. Add the Audio block and select an audio file.
  3. With controls enabled and the block deselected, clicking the audio
    should not play it or focus the controls.

Testing Instructions for Keyboard

Same.

@Mamaduka Mamaduka self-assigned this Jun 23, 2026
@Mamaduka Mamaduka added [Type] Enhancement A suggestion for improvement. [Block] Audio Affects the Audio Block labels Jun 23, 2026
@github-actions github-actions Bot added the [Package] Block library /packages/block-library label Jun 23, 2026
@Mamaduka Mamaduka requested review from scruffian and t-hamano June 23, 2026 06:21
@github-actions

Copy link
Copy Markdown

Size Change: +7 B (0%)

Total Size: 7.51 MB

📦 View Changed
Filename Size Change
build/scripts/block-library/index.min.js 324 kB +7 B (0%)

compressed-size-action

@t-hamano t-hamano left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@github-actions

Copy link
Copy Markdown

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: t-hamano <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@Mamaduka Mamaduka merged commit 0866d6e into trunk Jun 23, 2026
63 of 65 checks passed
@Mamaduka Mamaduka deleted the update/audio-block-inert-prop branch June 23, 2026 06:54
@github-actions github-actions Bot added this to the Gutenberg 23.5 milestone Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Audio Affects the Audio Block [Package] Block library /packages/block-library [Type] Enhancement A suggestion for improvement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants