@textbus/adapter-react 5.1.2 → 5.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -107,7 +107,11 @@ class ReactAdapter extends DomAdapter {
107
107
  this.componentRootElementCaches.set(component, rootNode);
108
108
  }
109
109
  else {
110
- this.componentRootElementCaches.remove(component);
110
+ // 当组件移动层级位置到原位置之前并重新渲染后,由于时序的原因,再删除缓存会导致组件找不到对应视图节点
111
+ // eslint-disable-next-line no-lonely-if
112
+ if (this.componentRootElementCaches.get(component) === rootNode) {
113
+ this.componentRootElementCaches.remove(component);
114
+ }
111
115
  }
112
116
  }
113
117
  });
package/bundles/index.js CHANGED
@@ -109,7 +109,11 @@ class ReactAdapter extends platformBrowser.DomAdapter {
109
109
  this.componentRootElementCaches.set(component, rootNode);
110
110
  }
111
111
  else {
112
- this.componentRootElementCaches.remove(component);
112
+ // 当组件移动层级位置到原位置之前并重新渲染后,由于时序的原因,再删除缓存会导致组件找不到对应视图节点
113
+ // eslint-disable-next-line no-lonely-if
114
+ if (this.componentRootElementCaches.get(component) === rootNode) {
115
+ this.componentRootElementCaches.remove(component);
116
+ }
113
117
  }
114
118
  }
115
119
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@textbus/adapter-react",
3
- "version": "5.1.2",
3
+ "version": "5.1.4",
4
4
  "description": "Textbus is a rich text editor and framework that is highly customizable and extensible to achieve rich wysiwyg effects.",
5
5
  "main": "./bundles/index.js",
6
6
  "module": "./bundles/index.esm.js",
@@ -26,8 +26,8 @@
26
26
  ],
27
27
  "dependencies": {
28
28
  "@tanbo/stream": "^1.2.7",
29
- "@textbus/core": "^5.1.2",
30
- "@textbus/platform-browser": "^5.1.2",
29
+ "@textbus/core": "^5.1.4",
30
+ "@textbus/platform-browser": "^5.1.4",
31
31
  "react": "^17.0.0 || ^18.0.0"
32
32
  },
33
33
  "devDependencies": {