[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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user