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 a required attribute to the search block so empty searches aren't submitted #15600

Closed
skorasaurus opened this issue May 13, 2019 · 3 comments
Labels
[Feature] Blocks Overall functionality of blocks

Comments

@skorasaurus
Copy link
Member

skorasaurus commented May 13, 2019

Describe the bug

The text field in the search block should be required so that empty or placeholder results are not submitted.
This is also a long-standing issue in core. (34886) that I hope could accompany this fix.

cc @gibrown
To reproduce
Steps to reproduce the behavior:

  1. Create a post or page
  2. add a search block
  3. publish the post or page
  4. visit the post or page

Expected behavior
an error message or notice stating that I'm submitting an empty form and a search term is required.

Additional context
Comprehensive testing has been done by Pacello Group and made some recommendations; my understanding that adding the 'required' attribute to the input element alone is a great start to this.

I've tested in firefox 66 on ubuntu; IE 11 and windows 10; and chrome and win 10 that by only adding the required attribute to the input element, visual messages for the user are displayed when the user submits a search that has a no value or a placeholder value.

(filed as a CPL employee).

@gibrown
Copy link

gibrown commented May 14, 2019

+1000 yes please.

@swissspidy swissspidy added the [Feature] Blocks Overall functionality of blocks label May 15, 2019
@skorasaurus
Copy link
Member Author

skorasaurus commented Nov 20, 2019

I've made a PR for this at #18635 ;

Notes and details are there.

@gziolo
Copy link
Member

gziolo commented Jan 8, 2020

Closed with #18635

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
Projects
None yet
Development

No branches or pull requests

4 participants