diff options
| author | Julien Mougenot <jum@odoo.com> | 2020-03-30 13:22:20 +0000 |
|---|---|---|
| committer | Julien Mougenot <jum@odoo.com> | 2020-04-06 13:38:45 +0000 |
| commit | e1f9648021039a2fc9b724c6562b9675e0f25059 (patch) | |
| tree | 7f6652aa9f3bfc0a5cca647ac1c8a67285a723c1 /addons/web/static/src/js/control_panel/search_bar.js | |
| parent | 9a0a793026143bc51b900ea2d81ed5060aacd4e0 (diff) | |
[FIX] web: empty search bar value on autocomplete close
Before this commit, the value of the search bar remained when the auto-completion
dropdown was closed (via click out or "Escape"). This was inconsistent with the
behaviour of the search bar which is supposed to show the auto-completion values
related to the search input.
Now, the value is cleared when the dropdown closes.
Task 2227590
closes odoo/odoo#49066
X-original-commit: 1c3e6ef0a5946ce415c9a210546b207011a51b3d
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/control_panel/search_bar.js')
| -rw-r--r-- | addons/web/static/src/js/control_panel/search_bar.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/web/static/src/js/control_panel/search_bar.js b/addons/web/static/src/js/control_panel/search_bar.js index 45ad67e2fb7..a56c3ea0973 100644 --- a/addons/web/static/src/js/control_panel/search_bar.js +++ b/addons/web/static/src/js/control_panel/search_bar.js @@ -81,6 +81,8 @@ odoo.define('web.SearchBar', function (require) { _closeAutoComplete() { this.state.sources = []; this.state.focusedItem = 0; + this.state.inputValue = ""; + this.inputRef.el.value = ""; this.focusOnUpdate(); } @@ -268,8 +270,6 @@ odoo.define('web.SearchBar', function (require) { operator: source.filterOperator || source.operator, }); } - this.state.inputValue = ""; - this.inputRef.el.value = ""; this._closeAutoComplete(); } |
