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 Block: Search #1800

Closed
melchoyce opened this issue Jul 7, 2017 · 10 comments · Fixed by #13583
Closed

Add Block: Search #1800

melchoyce opened this issue Jul 7, 2017 · 10 comments · Fixed by #13583
Labels
[Feature] Blocks Overall functionality of blocks [Feature] Widgets Screen The block-based screen that replaced widgets.php. [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). New Block Suggestion for a new block [Status] In Progress Tracking issues with work in progress
Milestone

Comments

@melchoyce
Copy link
Contributor

Attributes

  • Display search icon

States

Selected:

search

Neutral:

search block


Question:

  • I added "Display search icon," but should that be a theme decision, not a user decision?
@melchoyce melchoyce added Design New Block Suggestion for a new block labels Jul 7, 2017
@StaggerLeee
Copy link

StaggerLeee commented Jul 8, 2017

I hope all those native "widgets" in editor will be hidden on default. Or easy hidden with code.

With them I cannot say anymore to beginners Users, just go ahead in backend, you cannot ruin layout, design, or website, zero chance.
I set backend in an way they cannot ruin anything, even if they tried it by purpose. (Generally speaking about Editor role)

@paulwilde
Copy link
Contributor

paulwilde commented Jul 8, 2017

I added "Display search icon," but should that be a theme decision, not a user decision?

I believe it should be up to the theme in this case, and the option could be added by extending this particular block should the theme author choose to do so.

@afercia
Copy link
Contributor

afercia commented Jul 9, 2017

Ideally, placeholders should not be used as replacement for labels, see https://core.trac.wordpress.org/ticket/40331 especially in complex forms with several fields.

We've discussed this issue a few times in the accessibility team and agreed it could be acceptable to use a placeholder as in the "Neutral" mockup above for single form fields with a very specific task to accomplish. Even in this case, the search field will need a visually hidden label because the placeholder is going to not contribute any longer to the computation of the accessible name.

@melchoyce
Copy link
Contributor Author

Thanks for the feedback — I'll work on an update.

@karmatosed
Copy link
Member

I would say the search icon should be down to the theme, I am not sure about it as a user decision. My vote would be to let themes decide that.

@melchoyce
Copy link
Contributor Author

Updated to remove the search icon option, and add an editable label and placeholder:

search v2
search block v2

Thinking the label should be "Search" by default, but still editable. The placeholder can default to empty, unless someone clicks in to add one. Does this work better?

@karmatosed karmatosed added the Needs Design Feedback Needs general design feedback. label Jul 10, 2017
@karmatosed karmatosed added Needs Dev Ready for, and needs developer efforts and removed Design Needs Design Feedback Needs general design feedback. labels Sep 4, 2017
@karmatosed
Copy link
Member

As the project moves towards merge proposal, we are moving issues that aren't needed for that to projects. This doesn't mean they won't get done, they totally can and that's why we're moving to projects. This allows us to focus on the issues that have to happen to Gutenberg. I am closing this but it will live in projects.

@melchoyce
Copy link
Contributor Author

Updated mockup:

search_v3_1024

@danielbachhuber
Copy link
Member

Copying @westonruter's comment from #4501 (review):

It's a difficult question on whether to try to re-use get_search_form(). I think the most important thing is that the preview be faithful to the frontend. This is currently a challenge in Gutenberg for widgets because they have separate implementations between editing (JS) and viewing (PHP). A theme can override the PHP rendering to be something completely different already, which would break the WYSIWYG block editing preview. But this would be less likely than the theme defining a searchform.php. Since the block here is not going to be used in normal theme template contexts but rather in new Gutenberg contexts, I'm inclined to think that the search block you're defining here should break away from trying to re-use searchform.php to instead use a new Gutenberg block template, one that leverages all of the new customizability you are introducing. After all, the Latest Posts widget block is not re-using the Recent Posts widget template.

In the Gutenberg world, theme templates are going to need to be rethought anyway in favor of a block templating system, I think. (Especially to eliminate duplicating templates across PHP and JS.) So I don't think we should try too hard here to re-use existing WP theme templates.

@mtias mtias added Customization Issues related to Phase 2: Customization efforts [Feature] Widgets Screen The block-based screen that replaced widgets.php. labels Oct 7, 2018
@mtias mtias added this to the Future: Phase 2 milestone Oct 12, 2018
@gibrown
Copy link

gibrown commented Dec 13, 2018

The top search on wp.com is for "", and the second top is for "search". This occurs because users often click the search button rather than type something into the box first.

There is an unmerged patch for this in https://core.trac.wordpress.org/ticket/34886 that we should fix as a part of this.

@gziolo gziolo added [Status] In Progress Tracking issues with work in progress and removed Customization Issues related to Phase 2: Customization efforts labels Jan 22, 2019
@gziolo gziolo added [Feature] Blocks Overall functionality of blocks and removed Future Needs Dev Ready for, and needs developer efforts labels Jan 22, 2019
@afercia afercia added the [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). label Jan 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks [Feature] Widgets Screen The block-based screen that replaced widgets.php. [Focus] Accessibility (a11y) Changes that impact accessibility and need corresponding review (e.g. markup changes). New Block Suggestion for a new block [Status] In Progress Tracking issues with work in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants