diff options
| author | Géry Debongnie <ged@odoo.com> | 2019-01-23 08:32:29 +0000 |
|---|---|---|
| committer | Géry Debongnie <ged@odoo.com> | 2019-01-30 10:45:11 +0000 |
| commit | ad9f6aee93cc1674c4e02c1810d8a4fcb7804c6c (patch) | |
| tree | 94c12aefcb9622b3e3c5bc47efc040e60abc432d /addons/web/static/src/js/widgets | |
| parent | 1a774f9e0e9dbc67cf9661d6aa07f5ce5640d779 (diff) | |
[FIX] web: reload view when pressing enter in search bar
Before the control panel refactoring, whenever a user pressed ENTER in
the search bar (with no text), the current view was reloaded. This
untested behaviour was changed (not on purpose) with that refactoring:
instead of reloading, the search view add a useless filter in the list
of facets.
We restore the previous behaviour in this commit.
closes odoo/odoo#30503
Diffstat (limited to 'addons/web/static/src/js/widgets')
| -rw-r--r-- | addons/web/static/src/js/widgets/auto_complete.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/web/static/src/js/widgets/auto_complete.js b/addons/web/static/src/js/widgets/auto_complete.js index a25dc0150f5..33405aa4196 100644 --- a/addons/web/static/src/js/widgets/auto_complete.js +++ b/addons/web/static/src/js/widgets/auto_complete.js @@ -55,7 +55,10 @@ return Widget.extend({ } }); this.$input.on('keypress', function (ev) { - self.search_string = self.search_string + String.fromCharCode(ev.which); + if (ev.which > 31 && ev.which !== 127) { + // we filter control character out of the search string + self.search_string = self.search_string + String.fromCharCode(ev.which); + } if (self.search_string.length) { self.searching = true; var search_string = self.search_string; |
