[FIX] web_editor: fix wysiwyg focus
Ensure the wysiwyg.js focus() method will actually restore the cursor in the latest selection inside the editor. X-original-commit: 54877ecd8bf2454a7023e74aa739921e1468dad8 Part-of: odoo/odoo#102603
This commit is contained in:
@@ -1238,8 +1238,10 @@ export class OdooEditor extends EventTarget {
|
||||
focusNode,
|
||||
computedSelection.focusOffset,
|
||||
);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
historySetSelection(step) {
|
||||
this.deselectTable();
|
||||
@@ -2400,7 +2402,7 @@ export class OdooEditor extends EventTarget {
|
||||
focusNode: sel.focusNode,
|
||||
focusOffset: sel.focusOffset,
|
||||
};
|
||||
if (!sel.isCollapsed && this.isSelectionInEditable(sel)) {
|
||||
if (this.isSelectionInEditable(sel)) {
|
||||
this._latestComputedSelectionInEditable = this._latestComputedSelection;
|
||||
}
|
||||
return this._latestComputedSelection;
|
||||
|
||||
Reference in New Issue
Block a user