Skip to content
This repository was archived by the owner on May 5, 2021. It is now read-only.

Commit c96999c

Browse files
Gorashdmo-odoo
authored andcommitted
[FIX] DomLayout: fix for InlineNode using default renderer
The inline node can render child charNode before an inline node and wrap into a objectFragment. The Inline node have no reference because the domObject in 'unfilterdOldObjectMap' allready exist.
1 parent 4b7104a commit c96999c

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

packages/plugin-dom-layout/src/DomReconciliationEngine.ts

+6-9
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,15 @@ export class DomReconciliationEngine {
6868
for (const [node, domObject] of rendered) {
6969
let oldObjects = unfilterdOldObjectMap.get(domObject);
7070
if (!oldObjects) {
71-
this._addLocations(domObject, locations, node);
71+
this._addLocations(domObject, locations);
7272
oldObjects = [];
7373
unfilterdOldObjectMap.set(domObject, oldObjects);
7474
}
7575
const nodes = this._nodes.get(domObject);
76+
if (!nodes.includes(node)) {
77+
nodes.push(node);
78+
this._locations.set(domObject, [node]);
79+
}
7680
for (const linkedNode of nodes) {
7781
const id = this._renderedNodes.get(linkedNode);
7882
if (id && !oldObjects.includes(id)) {
@@ -1114,7 +1118,6 @@ export class DomReconciliationEngine {
11141118
private _addLocations(
11151119
domObject: GenericDomObject,
11161120
locations: Map<GenericDomObject, VNode[]>,
1117-
node?: VNode,
11181121
): VNode[] {
11191122
const nodes = locations.get(domObject);
11201123
if (nodes) {
@@ -1133,13 +1136,7 @@ export class DomReconciliationEngine {
11331136
}
11341137
}
11351138
}
1136-
if (node) {
1137-
if (node && !allNodes.includes(node)) {
1138-
allNodes.push(node);
1139-
this._locations.set(domObject, [node]);
1140-
}
1141-
this._nodes.set(domObject, allNodes);
1142-
}
1139+
this._nodes.set(domObject, allNodes);
11431140
return allNodes;
11441141
}
11451142
private _updateDom(id: DomObjectID): boolean {

0 commit comments

Comments
 (0)