diff options
| author | Benjamin Vray <bvr@odoo.com> | 2020-08-28 13:36:08 +0000 |
|---|---|---|
| committer | qsm-odoo <qsm@odoo.com> | 2020-10-01 17:58:45 +0000 |
| commit | 338f8d843832c339c52c00c7f4c41b5ab2d696ed (patch) | |
| tree | 2ea21d1d34cfa5f2a2840b61222a5fef06786663 /addons/web_editor/static/src/js/editor | |
| parent | a30edba504aa1b62aa02092112a55bca65cf9a0c (diff) | |
[FIX] web_editor: fix select with images in left panel
Before this commit, we were looking for text content inside SVG element
to set the selected value of a select in the editor panel.
After this commit, we avoid looking inside SVG tags.
task-2312878
closes odoo/odoo#56739
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/web_editor/static/src/js/editor')
| -rw-r--r-- | addons/web_editor/static/src/js/editor/snippets.options.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/editor/snippets.options.js b/addons/web_editor/static/src/js/editor/snippets.options.js index c7b30f86dfd..28a344a323c 100644 --- a/addons/web_editor/static/src/js/editor/snippets.options.js +++ b/addons/web_editor/static/src/js/editor/snippets.options.js @@ -861,7 +861,8 @@ const SelectUserValueWidget = BaseSelectionUserValueWidget.extend({ let textContent = ''; const activeWidget = this._userValueWidgets.find(widget => !widget.isPreviewed() && widget.isActive()); if (activeWidget) { - const value = (activeWidget.el.dataset.selectLabel || activeWidget.el.textContent.trim()); + const svgTag = activeWidget.el.querySelector('svg'); // useful to avoid searching text content in svg element + const value = (activeWidget.el.dataset.selectLabel || (!svgTag && activeWidget.el.textContent.trim())); const imgSrc = activeWidget.el.dataset.img; if (value) { textContent = value; |
