This issue only affects the instant-search-master branch. Spotted by @jsnmoon in https://github.com/Automattic/jetpack/pull/14248#pullrequestreview-339528217.
Search string is preserved in URL when closing the overlay with Escape.
Search string was removed from URL - it was reset to /.
I can no longer repro this one on instant-search-master so will close for now.
I have noticed that Esc will open the overlay though, which doesn't feel right! I'll fix that now.
I can still reproduce this on instant-search-master with Chrome 78:
1) Navigate to /.
2) Enter a query into the search input (e.g. this wedding).
3) Press enter on the search input.
4) Press escape while the focus is still on the search input.
What I expected to happen:
What happened instead:
q is automatically cleared after step 4.I'm guessing there's a key binding for Escape on search inputs.
It looks like this is the default behavior for search inputs in Chrome.
Instead of trying to suppress the default behavior, I think we should work on moving the focus inside the overlay instead.
This also happens in OS X Safari.
Firefox retains the query string.
I actually don't mind the current behavior. This is what I'm seeing:
/.Now we've moved the focus into the overlay (https://github.com/Automattic/jetpack/pull/14477), this no longer happens in Chrome 馃帀
Most helpful comment
It looks like this is the default behavior for search inputs in Chrome.
Instead of trying to suppress the default behavior, I think we should work on moving the focus inside the overlay instead.