Cover/Accordion: Exit on Enter#77301
Conversation
|
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. |
|
@ellatrix Do you think adding |
|
Thanks for the PR, thanks for the ping. It can be hard to keep up with everything, appreciate your patience; if you find a PR stuck in the future, consider pinging also In this case, I agree with the change. It's very simple, uses an existing (if private) API, and it solves a reasonable problem. There isn't really a compelling layout you can achieve with empty linebreaks (that without spaces inside collapse on the frontend anyway). On the other hand, this change fixes a problem where if the only block you've inserted is a cover block, you can't exit it with keyboard only (in part introduced in #76568). With this PR, you can. |
jasmussen
left a comment
There was a problem hiding this comment.
Tentative green light. I'd appreciate a second voice before you merge.
What?
Closes #77294.
This PR adds the
__experimentalOnEntersupport 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=JSONWhy?
It solves the problem of not be able to exit the block by pressing enter, it only adds empty paragraphs.
How?
Adding
__experimentalOnEntertosupportsconfig in block.json.Testing Instructions
Testing Instructions for Keyboard
Screenshots or screencast
Bildschirmaufnahme.2026-04-14.um.11.08.53.mov
Use of AI Tools
None.