Skip to content

Cover/Accordion: Exit on Enter#77301

Open
ocean90 wants to merge 1 commit intoWordPress:trunkfrom
wearerequired:fix/exit-on-enter-accordion
Open

Cover/Accordion: Exit on Enter#77301
ocean90 wants to merge 1 commit intoWordPress:trunkfrom
wearerequired:fix/exit-on-enter-accordion

Conversation

@ocean90
Copy link
Copy Markdown
Member

@ocean90 ocean90 commented Apr 14, 2026

What?

Closes #77294.

This PR adds the __experimentalOnEnter support key like done in 223baa2 and already used by other blocks: https://github.com/search?q=repo%3AWordPress%2Fgutenberg+__experimentalOnEnter+language%3AJSON&type=code&l=JSON

Why?

It solves the problem of not be able to exit the block by pressing enter, it only adds empty paragraphs.

How?

Adding __experimentalOnEnter to supports config in block.json.

Testing Instructions

  1. Add a Cover block
  2. Select a color and enter some text for the first paragraph
  3. Click enter twice

Testing Instructions for Keyboard

Screenshots or screencast

Bildschirmaufnahme.2026-04-14.um.11.08.53.mov

Use of AI Tools

None.

@ocean90 ocean90 requested a review from ellatrix April 14, 2026 09:20
@github-actions github-actions Bot added the [Package] Block library /packages/block-library label Apr 14, 2026
@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: ocean90 <ocean90@git.wordpress.org>

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

@ocean90 ocean90 added [Type] Bug An existing feature does not function as intended [Block] Cover Affects the Cover Block - used to display content laid over a background image [Block] Accordion Affects the Accordion Block labels Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Block] Accordion Affects the Accordion Block [Block] Cover Affects the Cover Block - used to display content laid over a background image [Package] Block library /packages/block-library [Type] Bug An existing feature does not function as intended

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Accordion Block: Pressing Enter in empty Paragraph should exit Accordion Panel

1 participant