Skip to content
Snippets Groups Projects
Commit c547d7c1 authored by fja-odoo's avatar fja-odoo
Browse files

[FIX] web_editor: fix input selection not supported


Some elements like the file input are not compatible with selection.
Since there is no reliable way of figuring out if the element is
compatible or not we will simply try catch it.

closes odoo/odoo#44470

X-original-commit: 1f0a0b380c2738795b0b5a7976692d9e9cd88583
Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
parent 28796cdd
No related branches found
No related tags found
No related merge requests found
......@@ -458,8 +458,14 @@ var RTEWidget = Widget.extend({
if (initialActiveElement && initialActiveElement !== document.activeElement) {
initialActiveElement.focus();
initialActiveElement.selectionStart = initialSelectionStart;
initialActiveElement.selectionEnd = initialSelectionEnd;
try {
initialActiveElement.selectionStart = initialSelectionStart;
initialActiveElement.selectionEnd = initialSelectionEnd;
} catch (e) {
// The active element might be of a type that
// does not support selection.
console.log('error', e);
}
}
},
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment