You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like the search box to lose focus if I press a shortcut (wouldn't need to be changeable - instinctively I was pressing Esc to leave so that I can navigate the articles but to my surprise I stayed in the search box).
@math-GH I'm surprised to find this seems to be default browser behavior. Funny, more than two decades and I didn't know escape didn't blur them. :-)
Edit: that is, after reading the OP and quickly double checking the same happened for me I assumed some key event listener was stealing it from the input element.
I'm mostly interested whether it makes sense to override the behavior to leave the input instead.
I do not expect that ESC will leave the focus because it is not an own window.
The question that would follow: where to put the focus after leaving the search box?
And why is TAB not used?
The question that would follow: where to put the focus after leaving the search box?
The expected behavior is to put focus on the page (compare pressing Esc after Ctrl+f). Interestingly all browsers break with that expected behavior, hopefully for good reason, which means the expected behavior would logically be not to override that default. But note that Gmail for example does in fact do so.
For me it additionally switched to another tab btw, but I haven't been able to reproduce that so I'm wondering if maybe I accidentally pressed something else as well.
Edit: never mind, Vivaldi does return focus to the page as expected, and Ctrl+Z on the page reopens the previously closed tab.
Activity
math-GH commentedon Jan 30, 2023
@Frenzie : Why is it labeled as bug?
Frenzie commentedon Jan 30, 2023
@math-GH I'm surprised to find this seems to be default browser behavior. Funny, more than two decades and I didn't know escape didn't blur them. :-)
Edit: that is, after reading the OP and quickly double checking the same happened for me I assumed some key event listener was stealing it from the input element.
Inverle commentedon Nov 15, 2025
When I press Esc in the search box, the input also gets cleared.
math-GH commentedon Nov 16, 2025
See this information about the default behavior of search inputs:
https://bugzilla.mozilla.org/show_bug.cgi?id=1055085
Inverle commentedon Nov 16, 2025
I'm mostly interested whether it makes sense to override the behavior to leave the input instead.
Frenzie commentedon Nov 16, 2025
The
type=searchinput behavior as implemented in Chromia strikes me as user-hostile. Ctrl+Z doesn't even work.Inverle commentedon Nov 16, 2025
Works for me
Frenzie commentedon Nov 16, 2025
Press Escape followed by Ctrl+Z.
math-GH commentedon Nov 16, 2025
Firefox:
Escape (=deletes the content)
followed by Ctrl+Z (brings back the deleted content)
works for me fine
Frenzie commentedon Nov 16, 2025
Chromia = most browsers that aren't Firefox ;-)
Inverle commentedon Nov 16, 2025
Oh interesting
Now do this:
Press Escape followed by Ctrl+Z (twice) and then Ctrl+Y
you'll be surprised by the result (in chrome)
In Firefox it works fine
math-GH commentedon Nov 16, 2025
I do not expect that
ESCwill leave the focus because it is not an own window.The question that would follow: where to put the focus after leaving the search box?
And why is
TABnot used?Frenzie commentedon Nov 16, 2025
In any case, it seems self-evident that
type=searchshould never be used. Its Firefox behavior is still user-hostile, just not explicitly broken.Frenzie commentedon Nov 16, 2025
The expected behavior is to put focus on the page (compare pressing Esc after Ctrl+f). Interestingly all browsers break with that expected behavior, hopefully for good reason, which means the expected behavior would logically be not to override that default. But note that Gmail for example does in fact do so.
Inverle commentedon Nov 16, 2025
What this does:
bug.mp4
Frenzie commentedon Nov 16, 2025
For me it additionally switched to another tab btw, but I haven't been able to reproduce that so I'm wondering if maybe I accidentally pressed something else as well.
Edit: never mind, Vivaldi does return focus to the page as expected, and Ctrl+Z on the page reopens the previously closed tab.
Esc leaves the search box (FreshRSS#9462)