@plcmp/pl-virtual-scroll 0.1.8 → 0.1.10

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.8",
3
+ "version": "0.1.10",
4
4
  "description": "Component for lazy list render.",
5
5
  "main": "pl-virtual-scroll.js",
6
6
  "repository": {
@@ -74,7 +74,7 @@ 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) {
77
+ if(Array.isArray(mutation.value) && Array.isArray(mutation.oldValue) && mutation.oldValue.length == mutation.value.length) {
78
78
  this.phyPool.forEach(i => {
79
79
  i.ctx.replace(this.items[i.index]);
80
80
  i.ctx.applyEffects();
@@ -181,9 +181,9 @@ class PlVirtualScroll extends PlElement {
181
181
 
182
182
 
183
183
  if (this.elementHeight && this.items.length)
184
- canvas.style.setProperty('max-height', this.elementHeight * this.items.length + 'px')
184
+ canvas.style.setProperty('height', this.elementHeight * this.items.length + 'px')
185
185
  else
186
- canvas.style.setProperty('max-height', 0)
186
+ canvas.style.setProperty('height', 0)
187
187
  }
188
188
 
189
189
  /**