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
Rollup merge of #72967 - integer32llc:prevent-default-arrows, r=kinnison
Don't move cursor in search box when using arrows to navigate results
## What happens
- Go to https://doc.rust-lang.org/stable/std/index.html
- Press 's' to focus the search box
- Type a query like 'test'
- Press the down arrow one or more times to change which search result is highlighted
- Press the up arrow once to go up one search result
- Notice the cursor in the search box is now at the beginning of your query, such that if you now typed 'a' the search box would contain 'atest', when it would be expected that the cursor would have remained where it was and if you typed 'a' at this point it would result in 'testa'
- Press the down arrow once to go down one search result
- Now notice the cursor is at the end of your query again
## What I expected
I expected that changing which search result was highlighted using the up and down arrows would have no effect on where the cursor was in the search box.
## The fix
This PR prevents the default action of the up and down arrows when the custom keydown events are happening during a search.
0 commit comments