Commit df5e739
committed
[FIX] html_editor: prevent header content loss on type change
Problem:
When trying to change the header type of "All products" in the
"/shop" page on Website, the title disappears.
Cause:
The title is `h1[data-oe-field]`. When we update it, we replace the
node with a new header node. This triggers `handleMutations` with
both the removed node and the new node. The old removed node with no
content is processed in `normalizeHandler`, which causes removal of
the content from the new node as well.
Solution:
We disable `setTag` on `o_editable`.
Steps to reproduce:
1. Enter Website.
2. Go to the cart and select the header "Order Summary".
3. Attempt to change the font style (Header 1, Header 2, etc.).
→ The header disappears.
opw-5106712
closes odoo#233286
X-original-commit: a10217b
Signed-off-by: David Monjoie (dmo) <[email protected]>
Signed-off-by: Walid Sahli (wasa) <[email protected]>1 parent c743e07 commit df5e739
File tree
3 files changed
+31
-0
lines changed- addons
- html_builder/static
- src/core
- tests
- html_editor/static/src/core
3 files changed
+31
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
279 | 289 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
574 | 574 | | |
575 | 575 | | |
576 | 576 | | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
577 | 596 | | |
578 | 597 | | |
579 | 598 | | |
580 | 599 | | |
| 600 | + | |
581 | 601 | | |
582 | 602 | | |
583 | 603 | | |
| |||
0 commit comments