diff options
Diffstat (limited to 'addons/web/static/src/js/chrome/search_view.js')
| -rw-r--r-- | addons/web/static/src/js/chrome/search_view.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/addons/web/static/src/js/chrome/search_view.js b/addons/web/static/src/js/chrome/search_view.js index 8ec1eb9ec71..94087c999b6 100644 --- a/addons/web/static/src/js/chrome/search_view.js +++ b/addons/web/static/src/js/chrome/search_view.js @@ -248,6 +248,12 @@ var SearchView = Widget.extend({ } e.preventDefault(); break; + case $.ui.keyCode.DOWN: + if (!this.autocomplete.is_expanded()) { + e.preventDefault(); + this.trigger_up('navigation_move', {direction: 'down'}); + break; + } } }, }, @@ -336,6 +342,9 @@ var SearchView = Widget.extend({ } return $.when.apply($, menu_defs).then(this.set_default_filters.bind(this)); }, + on_attach_callback: function () { + this._focusInput(); + }, get_title: function () { return this.title; }, @@ -417,6 +426,12 @@ var SearchView = Widget.extend({ if (this.$buttons) { this.$buttons.toggle(!this.headless && is_visible && this.visible_filters); } + this._focusInput(); + }, + /** + * puts the focus on the search input + */ + _focusInput: function () { if (!config.device.touch && config.device.size_class >= config.device.SIZES.SM) { this.$('input').focus(); } |
