[FIX] web_editor: prevent traceback on select image
Trying to select the contents of a content-less element should select the element itself instead. closes odoo/odoo#69173 X-original-commit: 6905eaad2ccaa782e3dce99b9581ed0194c37db9 Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit is contained in:
@@ -78,6 +78,9 @@ $.fn.extend({
|
||||
return this;
|
||||
},
|
||||
selectContent: function () {
|
||||
if (this.length && !this[0].hasChildNodes()) {
|
||||
return this.selectElement();
|
||||
}
|
||||
if (this.length) {
|
||||
const selection = document.getSelection();
|
||||
selection.removeAllRanges();
|
||||
|
||||
Reference in New Issue
Block a user