Skip to content

Commit

Permalink
[FIX] web_editor: force widget with reload to no-preview
Browse files Browse the repository at this point in the history
This commit resolves the issue that arises when a widget contains a
reload attribute but lacks a no-preview attribute. That config leads to
an "Uncaught Promise" error. With this update, when a reload attribute
is detected, the no-preview attribute is now automatically added,
preventing the error from occurring. The problem occurs since [1].

Steps to reproduce:
- Go to website
- Edit
- Click on the header
- In the navbar options, change the Mobile Alignment option.
=> Works but traceback anyway.

[1]: odoo@fcb16a3

task-3572334

closes odoo#139909

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
  • Loading branch information
SergeBayet authored and qsm-odoo committed Nov 2, 2023
1 parent fb8c608 commit bf54de9
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions addons/web_editor/static/src/js/editor/snippets.options.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,9 @@ const UserValueWidget = Widget.extend({
this.illustrationEl = document.createElement('i');
this.illustrationEl.classList.add('fa', this.options.dataAttributes.icon);
}
if (this.options.dataAttributes.reload) {
this.options.dataAttributes.noPreview = "true";
}
},
/**
* @override
Expand Down

0 comments on commit bf54de9

Please sign in to comment.