Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add wide/full alignment to the Search block #39073

Open
richtabor opened this issue Feb 24, 2022 · 5 comments
Open

Add wide/full alignment to the Search block #39073

richtabor opened this issue Feb 24, 2022 · 5 comments
Labels
[Block] Search Affects the Search Block - used to display a search field [Type] Enhancement A suggestion for improvement.

Comments

@richtabor
Copy link
Member

What problem does this address?

Is there a reason why wide/full width alignments were not included within the Search block? Currently the only way to get a search block to display wide or full is to add it to a Group block first, then set that parent block to the desired width.

I had to do that for implementing a wide search bar on the search template within my Wabi theme (source). Just doesn't seem like this should be a limitation for the block.

What is your proposed solution?

Add wide/full alignment support to the search block.

Screenshot

CleanShot 2022-02-24 at 13 36 41@2x

@richtabor richtabor added [Type] Enhancement A suggestion for improvement. [Block] Search Affects the Search Block - used to display a search field labels Feb 24, 2022
@brookewp
Copy link
Contributor

Thanks for the issue! I appreciate the example you shared for a wide width Search block, @richtabor. Do you have a use case in mind for a full width Search block?

I quickly looked into this and it appears like it would be fairly straightforward to implement assuming we could just adjust the block supports. However, it looks like a custom width option was chosen over wide/full width options in #24666. Perhaps @shaunandrews could share more context on this decision and reassess if we want to add this in now?

@richtabor
Copy link
Member Author

Hey @brookewp - totally missed this. Here's how I'm doing it currently: https://richtabor.com/?s=gutenberg

However, it looks like a custom width option was chosen over wide/full width options...

Yea, I think the resizable width is nice. You still can't go wide/fullwidth without the group block surrounding it, but that's probably fine.

I could probably be convinced that we don't actually need alignments like we have (as it currently does the float stuff, like inline images) — perhaps adopting the flex layout option may be more suitable. What do you think? I can open a separate issue and close this if you agree.

@brookewp
Copy link
Contributor

brookewp commented Jun 8, 2022

Hi @richtabor, thanks for the example!

perhaps adopting the flex layout option may be more suitable. What do you think?

Are you referring to flex layouts as defined here? The Search block is currently set to display: flex, so I might be misunderstanding the idea here. Do you have an example of what it might look like?

@richtabor
Copy link
Member Author

The Search block currently uses float alignment, like the image block. The image block makes sense as it could search an inline block, but the Search is unlikely to.

Alignment settings:

CleanShot 2022-06-14 at 17 11 40@2x

Left aligned:

CleanShot 2022-06-14 at 17 11 56@2x

Maybe the justification/flex left/center/right controls make more sense here instead, to prevent alignment mishaps when someone attempts to align it left/right and it works like the Image block, vs the Buttons block:

CleanShot 2022-06-14 at 17 14 52@2x

@brookewp
Copy link
Contributor

Thanks for clarifying! I agree, your suggested approach makes sense to me. 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Search Affects the Search Block - used to display a search field [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

2 participants