[FIX] web_editor: tab outside link hides linkpopover

Before this commit:

Tab on link moves link table but the link popover stucks.

After this commit:

Tab outsided the link hides the linkpopover.

task-3389015

closes odoo/odoo#145297

X-original-commit: e9ada60cb1f6986a578e17ddce1f5ae6a6fe95dc
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
This commit is contained in:
visp-odoo
2023-12-07 08:30:19 +00:00
parent 405483cb06
commit ff8ee482b8
@@ -2749,9 +2749,10 @@ export class Wysiwyg extends Component {
}
}
_onSelectionChange() {
if (this.odooEditor.autohideToolbar) {
const isVisible = this.linkPopover && this.linkPopover.el.offsetParent;
if (isVisible && !this.odooEditor.document.getSelection().isCollapsed) {
if (this.odooEditor.autohideToolbar && this.linkPopover) {
const selectionInLink = getInSelection(this.odooEditor.document, 'a') === this.linkPopover.target;
const isVisible = this.linkPopover.el.offsetParent;
if (isVisible && !selectionInLink) {
this.linkPopover.hide();
}
}