diff --git a/addons/web/static/src/core/dropdown/dropdown.js b/addons/web/static/src/core/dropdown/dropdown.js index 9368fce9d61..5d0c90a5734 100644 --- a/addons/web/static/src/core/dropdown/dropdown.js +++ b/addons/web/static/src/core/dropdown/dropdown.js @@ -307,6 +307,13 @@ export class Dropdown extends Component { } } + /** + * Return true if both active element are same. + */ + isInActiveElement() { + return this.ui.activeElement === this.myActiveEl; + } + /** * Used to close ourself on outside click. * @@ -318,7 +325,7 @@ export class Dropdown extends Component { return; } // Return if it's a different ui active element - if (this.ui.activeElement !== this.myActiveEl) { + if (!this.isInActiveElement()) { return; }