Search block: Derive 'isSearchFieldHidden' value#77082
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. |
|
Size Change: -112 B (0%) Total Size: 7.74 MB 📦 View Changed
ℹ️ View Unchanged
|
|
Flaky tests detected in 7f6ae24. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/24069387453
|
ramonjd
left a comment
There was a problem hiding this comment.
LGTM.
Insert the Search block.
Here were my test steps 😄
- Set button position to "Button only"
- Confirm no extra undo steps are created just from selecting/deselecting the block
- Load a post that already has a Search block saved with the old isSearchFieldHidden attribute, and confirm it still renders and edits correctly
2026-04-07.16.57.33.mp4
I don't think it's a big deal to lose the click + close, but for space-faring meta humans in the future returning to look at this PR to learn from our prehistoric ways, it might be good to mention in the PR. 🚀
|
Thanks for the review, @ramonjd! |
Co-authored-by: Mamaduka <mamaduka@git.wordpress.org> Co-authored-by: ramonjd <ramonopoly@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org>
What?
Closes #53174.
Introduced via #50487.
PR removes unnecessary attribute sync via effects, which was creating unwanted undo history entries. Use a simple derived state to apply editor-only classes.
I know this isn't 100% match to previous behavior, but expanding the block on selection is what we need most of the time.
What's different from trunk?
Clicking on the search button in the block editor canvas will no longer collapse/example the input field.
How?
I came to the same conclusion as @t-hamano in #52519 (comment).
Testing Instructions
Testing Instructions for Keyboard
Same.
Screenshots or screencast
CleanShot.2026-04-07.at.09.51.31.mp4
Use of AI Tools
None.