Files
odoo_source/addons/web_editor
abd-msyukyu-odoo 576afb3f27 [FIX] web_editor: reset MoveNodePlugin when switching record
How to reproduce:
- open a record with an html_field (i.e. todo or a Knowledge article)
- switch back and forth with the pager or the knowledge sidebar between 2
  records

Current behavior:
- traceback `this._elementHookMap.get(element)` is undefined

Expected behavior:
- no traceback

Technical explanation:

When changing the editable content (i.e. `resetContent` when changing record),
there is no guarantee that `_intersectionObserverCallback`
(intersectionObserver) won't be called before `_updateHooks` (mouseMove/resize
after a mutation occured).

This is an issue because `this._elementHookMap` may not yet have a hook element
related to the editable element which stops intersecting the document.
If such a case occurs, the next `_updateHooks` should be called when the
mutationObserver flags `_resetHooksNextMouseMove` to `true` and then after the
next `mouseMove`  (or after the next resize).

Ignore the hook style update if there is currently no hook for an element which
stops intersecting.

Remove a redundant check in `_getMovableElements`

task-3506666

closes odoo/odoo#135464

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-09-22 15:06:02 +00:00
..
…
2023-06-12 22:39:26 +02:00