@plcmp/pl-virtual-scroll 0.1.11 → 0.1.12

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.11",
3
+ "version": "0.1.12",
4
4
  "description": "Component for lazy list render.",
5
5
  "main": "pl-virtual-scroll.js",
6
6
  "repository": {
@@ -81,6 +81,12 @@ class PlVirtualScroll extends PlElement {
81
81
  i.ctx._ti.applyBinds();
82
82
  });
83
83
  }
84
+
85
+ // Временный решение, занулям физический пулл в случаях когда значения массива приходят внутри объектов
86
+ // Исправить в будущем на более умную замену значений
87
+ if(Array.isArray(mutation.value) && Array.isArray(mutation.oldValue) && mutation.oldValue.length != mutation.value.length) {
88
+ this.phyPool = [];
89
+ }
84
90
  if (index !== undefined && +index >= 0) {
85
91
  let el = this.phyPool.find(i => i.index === +index);
86
92
  if (el && rest.length > 0) {
@@ -225,6 +231,7 @@ class PlVirtualScroll extends PlElement {
225
231
  if (n.style) {
226
232
  n.style.transform = `translateY(${target.offset}px)`;
227
233
  n.style.position = 'absolute';
234
+ n.setAttribute('virtualOffser', target.offset);
228
235
  }
229
236
  });
230
237
  return target;