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.
Comment | File | Size | Author |
---|---|---|---|
#4 | entity_share-enter_key-3087502-4.patch | 1.76 KB | Grimreaper |
Screenshot from 2019-10-11 14-14-19.png | 48.93 KB | quicksketch |
Comments
Comment #2
quicksketchJust 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.
Comment #3
GrimreaperComment #4
GrimreaperThanks 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.
Comment #5
quicksketchThis seems to work! Also I appreciate shortening the field label to just "Search".
Comment #7
GrimreaperThanks for the feedback, this is merged now.