[FIX] web_editor: ctrl+a container should be an element
If somehow there is no selection but the `_handleShortcuts` handler still gets called with `CTRL+A`, `container` would be a JQUERY object instead of an element leading to a crash in `selectNodeContents` which expects a `Node`. task-3506666 closes odoo/odoo#136499 X-original-commit: e6fac045282465960c0e4a7ecbbbb5e5ac8dff92 Signed-off-by: David Monjoie (dmo) <dmo@odoo.com> Signed-off-by: Damien Abeloos (abd) <abd@odoo.com>
This commit is contained in:
@@ -2064,7 +2064,7 @@ export class Wysiwyg extends Component {
|
||||
closestElement(selection.anchorNode, containerSelector)) ||
|
||||
// In case a suitable container could not be found then the
|
||||
// selection is restricted inside the editable area.
|
||||
this.$editable.find(containerSelector);
|
||||
this.$editable.find(containerSelector)[0];
|
||||
if (container) {
|
||||
const range = document.createRange();
|
||||
range.selectNodeContents(container);
|
||||
|
||||
Reference in New Issue
Block a user