Closed sigurdm closed 1 week ago
Reading upon this a bit, and my finding so far is:
The HTML specification encourages browsers to allow implicit submission (as in our case to submit the form on hitting enter after typing): https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#implicit-submission
My non-scientific sampling of browsers and forum entries suggest to me that most users have the problem the other way around: the form submits even when they are not intending to. There also may be extensions that interfere with form submission.
I see two alternatives here:
We could add a submit button with the icon on it, styling it the same way as the magnifier glass today. The drawback here would be tab order: the page starts with the input field focused, and then it would jump upfront on tabbing.
We could catch the enter key in the input field, and trigger a form submission via JavaScript. We should also prevent propagation, so that there is no accidental double-submission. (sending out a PR for it soon)
@sigurdm do we know what browsers are affected?
No - there is unfortunately no more context than what I quoted.
I first suggested the poster to file an issue, and when they didn't after a few days I posted it here.
As we don't have any way to reproduce the issue, and e.g. Google search has similar icon that is not clickable, I'm closing this issue too.
We had a request for this.
"please make the lens icon clickable instead of relying on enter key press to execute search. Some browsers don't respond to enter key press and this is frustrating when browsing your magnificent website. thank you"