[webui][ntp] Add voice search search and link keyboard shortcuts
Adds support to submit a query by pressing <ENTER> or <SPACE>. We accomplish this by installing a voice search overlay wide keydown listener to process this keyboard shortcut. Unfortunately, the same keyboard shortcut also triggers the close button, which was the first element focused upon opening the overlay before this CL. To submit a query instead of closing the dialog by default, this CL adds a hidden focusable div that captures the focus upon opening the dialog. This CL also turns the close button into a cr-icon-button, which makes the UI more consistent and makes the button swallow keydown events (that way we don't both submit a query and close the overlay with <Enter> and <SPACE>). + Add <SPACE> keyboard shortcut to trigger links. + Fix bug where any keyboard shortcut other than <CTRL> + <SHIFT> + <.> closes the voice search overlay. Fixed: 1088482 Change-Id: I0c7c40d88503a3ae0d7343a077f8b086968e470b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2238781Reviewed-by:Esmael Elmoslimany <aee@chromium.org> Commit-Queue: Tibor Goldschwendt <tiborg@chromium.org> Cr-Commit-Position: refs/heads/master@{#777474}
Showing
Please register or sign in to comment