Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#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.
- Loading branch information