Chromium Code Reviews| Index: pkg/dartdoc/lib/src/client/dropdown.dart |
| diff --git a/pkg/dartdoc/lib/src/client/dropdown.dart b/pkg/dartdoc/lib/src/client/dropdown.dart |
| index eab7e7901b8be63d230736461329f6f5120abd42..eed32aea797bc1923d3f542ff0375eced27d9672 100644 |
| --- a/pkg/dartdoc/lib/src/client/dropdown.dart |
| +++ b/pkg/dartdoc/lib/src/client/dropdown.dart |
| @@ -324,8 +324,11 @@ void hideDropDown() { |
| /** Activate search on Ctrl+3 and S. */ |
| void shortcutHandler(KeyboardEvent event) { |
| - if (event.keyCode == 0x33/* 3 */ && event.ctrlKey || |
| - event.keyCode == 0x53/* S */) { |
| + if (event.keyCode == 0x33/* 3 */ && event.ctrlKey) { |
| + searchInput.focus(); |
| + event.preventDefault(); |
| + } else if (event.target != searchInput && event.keyCode == 0x53/* S */) { |
| + // Avoid preventing writing 's' in the search input. |
|
Lasse Reichstein Nielsen
2012/10/05 14:06:21
Avoid preventing -> Allow (or "Don't prevent"). Tw
Johnni Winther
2012/10/05 14:34:01
Yes it does! Done.
|
| searchInput.focus(); |
| event.preventDefault(); |
| } |