[FIX] web: keep focus on searchbar when Tab pressed

before this commit: when searchbar has autocomplete and user press Tab key then
focus goes out of searchbar input while it should keep focus on searchbar so that
user can do search on other term.

after this commit: when searching on searchbar and pressing Tab key will keep focus
on searchbar input so that user can search again.

task-2393772

closes odoo/odoo#66239

X-original-commit: ae90842be8a87999e0cdbbf00b86b1bbf92992ce
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit is contained in:
Mohammed Shekha
2021-02-16 07:53:44 +00:00
parent 9f870f83b2
commit 2d2019d4d2
@@ -421,6 +421,7 @@ odoo.define('web.SearchBar', function (require) {
/* falls through */
case 'Tab':
if (this.state.inputValue.length) {
ev.preventDefault(); // keep the focus inside the search bar
this._selectSource(currentItem);
}
break;