This is a follow-up to #3077815: Basic Search (such as on Title) on Pull Form where I encountered a big usability issue with the new search feature. My first attempt to search completely failed because I couldn't get the search function to actually execute. It did not occur to me to tab out of the field (apparently the only way to trigger it currently).

Instead I hit the return key, which I would expect to execute a search. But instead of searching it actually submitted the form, which then resulted in a validation error indicating that at least one item should be selected.

Screenshot:

This validation also don't work so great with the optional core module "Inline Form Errors", as you can see in the screenshot.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quicksketch created an issue. See original summary.

quicksketch’s picture

Just a thought that one "easy way" of handling this would be to have a Search button that fired the AJAX, rather than doing it on the textfield. As long as it is is the first button in the form, the browser's handling of the return key will submit it instead of the Synchronize button.

Grimreaper’s picture

Assigned: Unassigned » Grimreaper
Grimreaper’s picture

Assigned: Grimreaper » Unassigned
Status: Active » Needs review
FileSize
1.76 KB

Thanks to a co-worker I discovered the "keypress" key in #ajax.

I tried with another submit button, (#type button and not submit otherwise other complications occured) but then it would have required to remove the #ajax on the textfield.

I am waiting for your feedback before merging.

quicksketch’s picture

Status: Needs review » Reviewed & tested by the community

This seems to work! Also I appreciate shortening the field label to just "Search".

  • Grimreaper authored c89a26b on 8.x-2.x
    Issue #3087502 by Grimreaper, quicksketch: Enter / Return key should...
Grimreaper’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the feedback, this is merged now.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.