WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.35k stars 4.13k forks source link

Search block: setting option to button only causes UI inconsistency in displaying search field #64988

Open annezazu opened 2 weeks ago

annezazu commented 2 weeks ago

When adding the search block to the navigation block and setting it to display button only, I noticed some wonkiness in whether the search field is shown. The current experience make it seem like you have to select Button only twice for it to "work" (you don't! it works the first time but it's trying to show the search field to show you can customize the placeholder) and then, when selecting it, it won't show the search field until you click twice. The entire experience doesn't feel very refined and consistent. The following videos were taking using WordPress 6.6.1 with Gutenberg 19.1.

This first came up from @marc-pi in a prior issue:

there is just an inconcistencies in the Editor when clicking on the "button only" option, we have to insist and click twice to make it effective, but we can live with it we can close

Inconsistencies when search field is shown

Ensure consistency so that, upon selecting the block, each time the search field is shown so you can edit the placeholder text.

https://github.com/user-attachments/assets/69fe8dd4-21e1-4ab4-baad-3e87c234c3cd

Better show that you don't need to select "button only" twice

Better communicate that even the "button only" shows a placeholder field so you can customize it on the front end, even as that doesn't show until you click the button. Right now, it seems as if you have to select the option twice for it to stick as shown below:

https://github.com/user-attachments/assets/22c622f4-036f-4548-863c-62f20fd305b2

jasmussen commented 2 weeks ago

The main feedback I'd share on this is that the way to configure the search block hasn't scaled well, and can likely benefit from some of the options existing in the inspector panel. It's especially the button position dropdown that's tricky, and could benefit from a rethink.

It's not clear that a redesign is the immediate solution here, however, this looks like a bug that should ideally be investigated and fixed.