[FIX] portal: fix portal searchbar

Small fix which removes an error when the user tries to search for an element using the enter key.
task-2508883
Related PR: https://github.com/odoo/odoo/pull/70305

closes odoo/odoo#71753

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
Cedric Prieels (cpr)
2021-06-15 09:03:57 +00:00
parent a6b4893c57
commit e8c586b6d4
2 changed files with 5 additions and 13 deletions
+4 -12
View File
@@ -96,9 +96,8 @@ publicWidget.registry.PortalHomeCounters = publicWidget.Widget.extend({
publicWidget.registry.portalSearchPanel = publicWidget.Widget.extend({
selector: '.o_portal_search_panel',
events: {
'click .search-submit': '_onSearchSubmitClick',
'click .dropdown-item': '_onDropdownItemClick',
'keyup input[name="search"]': '_onSearchInputKeyup',
'submit': '_onSubmit',
},
/**
@@ -136,12 +135,6 @@ publicWidget.registry.portalSearchPanel = publicWidget.Widget.extend({
// Handlers
//--------------------------------------------------------------------------
/**
* @private
*/
_onSearchSubmitClick: function () {
this._search();
},
/**
* @private
*/
@@ -156,10 +149,9 @@ publicWidget.registry.portalSearchPanel = publicWidget.Widget.extend({
/**
* @private
*/
_onSearchInputKeyup: function (ev) {
if (ev.keyCode === $.ui.keyCode.ENTER) {
this._search();
}
_onSubmit: function (ev) {
ev.preventDefault();
this._search();
},
});
+1 -1
View File
@@ -310,7 +310,7 @@
</div>
<input type="text" class="form-control form-control-sm" placeholder="Search" t-att-value='search' name="search"/>
<span class="input-group-append">
<button class="btn btn-secondary search-submit" type="button">
<button class="btn btn-secondary o_wait_lazy_js" type="submit">
<span class="fa fa-search"/>
</button>
</span>