@plcmp/pl-virtual-scroll 0.1.5 → 0.1.7

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plcmp/pl-virtual-scroll",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "Component for lazy list render.",
5
5
  "main": "pl-virtual-scroll.js",
6
6
  "repository": {
@@ -74,6 +74,13 @@ class PlVirtualScroll extends PlElement {
74
74
  let [, index, ...rest] = normalizePath(mutation.path);
75
75
  switch (mutation.action) {
76
76
  case 'upd':
77
+ if(mutation.oldValue?.length == mutation.value.length) {
78
+ this.phyPool.forEach(i => {
79
+ i.ctx.replace(this.items[i.index]);
80
+ i.ctx.applyEffects();
81
+ i.ctx._ti.applyBinds();
82
+ });
83
+ }
77
84
  if (index !== undefined && +index >= 0) {
78
85
  let el = this.phyPool.find(i => i.index === +index);
79
86
  if (el && rest.length > 0) {
@@ -102,7 +109,7 @@ class PlVirtualScroll extends PlElement {
102
109
  i.index = null;
103
110
  }
104
111
  });
105
- this.render();
112
+ setTimeout(() => this.render(), 0);
106
113
 
107
114
  break;
108
115
  }