[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:
abd-msyukyu-odoo
2023-09-25 15:20:26 +00:00
parent 2cf112abbf
commit 74013202c6
@@ -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);