fixed search block front-end placeholder issue.#45838
fixed search block front-end placeholder issue.#45838viralsampat-multidots wants to merge 4 commits intoWordPress:trunkfrom viralsampat-multidots:fixed/45837_search_block_placeholder
Conversation
|
|
|
👋 Thanks for your first Pull Request and for helping build the future of Gutenberg and WordPress, @viralsampat-multidots! In case you missed it, we'd love to have you join us in our Slack community, where we hold regularly weekly meetings open to anyone to coordinate with each other. If you want to learn more about WordPress development in general, check out the Core Handbook full of helpful information. |
alexstine
left a comment
There was a problem hiding this comment.
@viralsampat-multidots Thanks for the PR! Just one small suggestion.
|
|
||
| // Check array attributes place holder value isset or not | ||
| if( empty( $attributes['placeholder'] ) ) { | ||
| $attributes['placeholder'] = 'Optional placeholder…'; |
There was a problem hiding this comment.
| $attributes['placeholder'] = 'Optional placeholder…'; | |
| $attributes['placeholder'] = __( 'Search here…' ); |
There was a problem hiding this comment.
Hello @alexstine
Hope you are doing well.
As I checked still this issue is open. So, Can I have to make this change and add another PR for review?
Please review it and let me know your feedback. Then I will work accordingly.
Thanks,
|
Hi, Thank you for your effort. At first impression, this would appear to be a logical and easy fix although I am skeptical whether WP should implement a placeholder (on the front end or the backend) in a search box. There are few posts from respectable accessibility and usability outlets that discourage their use. |
|
I'd rather not have the placeholder at all. However, if it exists on the back-end, makes little sense to not include it on the front-end or remove it from the back-end. |
Hello @alexstine I know the placeholder exists on the back end, makes little sense to not include it on the front end. But for accessibility and user interaction purposes, we can add it on the front end as well. I have made the above-mentioned change and I have removed placeholder text from the back end as well. Please let me know still need to make any changes or share your feedback for the same. Thanks, |
|
@viralsampat-multidots While this PR looks fine I think, probably need to remove this from the back-end. |
|
Hello Team, Here, I am seeing one error message like "This branch has conflicts that must be resolved", So please let me know if I need to do anything to move further. Please share your valuable feedback. Thanks, |
Hey there! |
|
@aristath How does this one move forward? I am actually unsure anything can happen here if this placeholder field on the back-end is currently being used. It is not displayed on the front-end so in theory it could be eliminated but this feels more for project leadership to decide. I am not 100% against placeholder text but I would prefer not introducing a feature that users will misuse. It does appear that this is somehow being used though. If you check the front-end of the site, placeholder text is there. https://wordpress.org/documentation/article/wordpress-block-editor/ I think we might be too late to fully eliminate placeholder text. Thanks. |
|
@alexstine I think that we have two options for now.
What do you guys think? Please share your feedback for the same. Thanks, |
|
Sorry for the delay @viralsampat-multidots; Thank you again for your effort. Personally, I would not have the use of placeholders although the degree of negative impact when they're used varies (based on color contrast, length of the placeholder text and of the text both etc). (A couple more articles that discourage the use of placeholders) https://design-system.service.gov.uk/components/text-input/ https://www.smashingmagazine.com/2018/06/placeholder-attribute/ How to proceed: |
What?
The PR is added placeholder text into the search block for front-end view.
Why?
I have checked search block and found that the placeholder text was displaying on editor side, But somehow it not displaying on front-end side. So, I have added placeholder text into the attributes array added it for front-end.
How?
First, I have checked its code and found that attribute array key "Placeholder" is blank. So, I have added if condition and then added value for array key "Placeholder".
Testing Instructions
Screenshots or scree
Closed: #45837