Fix keyboard interaction in search modal

Problem to solve

Some keyboard interactions home/end are performing differently than they used to with global search.

Proposal

  • when focus is in input - delegate the home/end to the default browser behaviour (select text)
  • when focus is on the option - do as we do now - focus first/last option

Feedback

The new navigation changes the Search functionality to a popup. This is fine in itself, but standard keyboard navigation in the popup is broken.

Here is one example...

Steps to reproduce (Chrome/Windows):

  • Click the magnifying glass icon or press / to open the new search dialog
  • Type some text in the search box
  • Press Shift+home key combination.

Expected result:

  • The text you typed is now selected (ready to be replaced by the next character you type, or cleared if you press delete).

Actual result:

  • The focus is taken to the first item in the dropdown.

Similarly, home/end by themselves are broken (they also navigate items in the dropdown).

#409005 (comment 1459151452)