@textbus/adapter-viewfly 5.1.3 → 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.
@@ -61,7 +61,10 @@ class ViewflyAdapter extends DomAdapter {
61
61
  ref = createDynamicRef(rootNode => {
62
62
  this.componentRootElementCaches.set(component, rootNode);
63
63
  return () => {
64
- this.componentRootElementCaches.remove(component);
64
+ // 当组件移动层级位置到原位置之前并重新渲染后,由于时序的原因,再删除缓存会导致组件找不到对应视图节点
65
+ if (this.componentRootElementCaches.get(component) === rootNode) {
66
+ this.componentRootElementCaches.remove(component);
67
+ }
65
68
  };
66
69
  });
67
70
  this.componentRefs.set(component, ref);
package/bundles/index.js CHANGED
@@ -63,7 +63,10 @@ class ViewflyAdapter extends platformBrowser.DomAdapter {
63
63
  ref = core$1.createDynamicRef(rootNode => {
64
64
  this.componentRootElementCaches.set(component, rootNode);
65
65
  return () => {
66
- this.componentRootElementCaches.remove(component);
66
+ // 当组件移动层级位置到原位置之前并重新渲染后,由于时序的原因,再删除缓存会导致组件找不到对应视图节点
67
+ if (this.componentRootElementCaches.get(component) === rootNode) {
68
+ this.componentRootElementCaches.remove(component);
69
+ }
67
70
  };
68
71
  });
69
72
  this.componentRefs.set(component, ref);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@textbus/adapter-viewfly",
3
- "version": "5.1.3",
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,9 +26,9 @@
26
26
  ],
27
27
  "dependencies": {
28
28
  "@tanbo/stream": "^1.2.7",
29
- "@textbus/core": "^5.1.3",
30
- "@textbus/platform-browser": "^5.1.3",
31
- "@textbus/platform-node": "^5.1.3",
29
+ "@textbus/core": "^5.1.4",
30
+ "@textbus/platform-browser": "^5.1.4",
31
+ "@textbus/platform-node": "^5.1.4",
32
32
  "@viewfly/core": "^2.0.0",
33
33
  "@viewfly/platform-browser": "^2.0.0"
34
34
  },