[FIX] web_editor: unlink toolbar button is displayed when range is collapsed

Before this commit:

In mobile view, when text as well as link is in range the unlink button
in the toolbar was visible.

After this commit:

The unlink button is only displayed when link is in range

Task-3184393

closes odoo/odoo#115161

X-original-commit: 5cab1c90b13074e642f3da3a773c55d37419f90b
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit is contained in:
maad-odoo
2023-03-16 13:07:54 +01:00
committed by Odoo
parent d805349855
commit ff283b6b1a
@@ -2731,11 +2731,13 @@ export class OdooEditor extends EventTarget {
}
}
if (this.options.autohideToolbar && !this.toolbar.contains(sel.anchorNode)) {
if (show !== undefined && !this.isMobile) {
this.toolbar.style.visibility = show ? 'visible' : 'hidden';
}
if (show === false) {
return;
if (!this.isMobile) {
if (show !== undefined) {
this.toolbar.style.visibility = show ? 'visible' : 'hidden';
}
if (show === false) {
return;
}
}
}
if (!this.isSelectionInEditable(sel)) {