Search Block : No spacing between search field and button in "Button Only" mode
Description
When using the Search block with the "Button only" mode, clicking the button expands the search input field. However, there is no spacing between the search input field and the search button. They sit flush against each other without any gap. This behavior occurs in both the editor and on the front end.
Expected: There should be a visible gap/spacing between the search input field and the search button when the search field is expanded, consistent with the default search block layout ("Button outside"). Actual: The search input field and search button touch each other with 0px spacing between them.
Step-by-step reproduction instructions
- Open the Post Editor or Site Editor.
- Insert a Search block.
- In the block settings sidebar under Settings, change Button position to "Button only".
- In the editor, select the block so the input field expands, or save and view on the front end and click the search button to expand the search input.
- Observe that there is no space/gap between the search input field and the search button.
Screenshots, screen recording, code snippet
https://github.com/user-attachments/assets/46bc0f5d-b4be-4b18-9792-acb9ee1d575e
Environment info
- WordPress 7.1.4 with Gutenberg plugin active
- Gutenberg trunk
- Theme: TT5
Please confirm that you have searched existing issues in the repo.
- [x] Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
- [x] Yes
Please confirm which theme type you used for testing.
- [x] Block
- [ ] Classic
- [ ] Hybrid (e.g. classic with theme.json)
- [ ] Not sure
Thanks for the clear report and the video, @dpmehta.
This is the same bug as https://github.com/WordPress/gutenberg/issues/65608: in "Button only" mode the opened search field touches the button, with no gap. Both issues ask for the same spacing, so I'm closing this one to keep the discussion in one place.
I checked on trunk with Twenty Twenty-Five: the gap is still 0px in the editor and on the front end.
Partly automated with help from Claude.