@vaadin/component-base 24.0.6 → 24.0.8
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": "@vaadin/component-base",
|
|
3
|
-
"version": "24.0.
|
|
3
|
+
"version": "24.0.8",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"@vaadin/testing-helpers": "^0.4.0",
|
|
43
43
|
"sinon": "^13.0.2"
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "c3177ddc192a4006c459bd8cfc4f9c9c89866345"
|
|
46
46
|
}
|
package/src/element-mixin.js
CHANGED
package/src/slot-controller.js
CHANGED
|
@@ -211,19 +211,20 @@ export class SlotController extends EventTarget {
|
|
|
211
211
|
}
|
|
212
212
|
|
|
213
213
|
if (newNodes && newNodes.length > 0) {
|
|
214
|
-
// Custom node is added, remove the current one.
|
|
215
|
-
current.forEach((node) => {
|
|
216
|
-
if (node && node.isConnected) {
|
|
217
|
-
node.parentNode.removeChild(node);
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
|
|
221
214
|
if (this.multiple) {
|
|
222
|
-
|
|
215
|
+
// Remove default node if exists
|
|
216
|
+
if (this.defaultNode) {
|
|
217
|
+
this.defaultNode.remove();
|
|
218
|
+
}
|
|
219
|
+
this.nodes = [...current, ...newNodes].filter((node) => node !== this.defaultNode);
|
|
223
220
|
newNodes.forEach((node) => {
|
|
224
221
|
this.initAddedNode(node);
|
|
225
222
|
});
|
|
226
223
|
} else {
|
|
224
|
+
// Remove previous node if exists
|
|
225
|
+
if (this.node) {
|
|
226
|
+
this.node.remove();
|
|
227
|
+
}
|
|
227
228
|
this.node = newNodes[0];
|
|
228
229
|
this.initAddedNode(this.node);
|
|
229
230
|
}
|
|
@@ -279,6 +279,13 @@ export class IronListAdapter {
|
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
281
|
|
|
282
|
+
// When reducing size while invisible, iron-list does not update items, so
|
|
283
|
+
// their hidden state is not updated and their __lastUpdatedIndex is not
|
|
284
|
+
// reset. In that case force an update here.
|
|
285
|
+
if (!this._isVisible) {
|
|
286
|
+
this._assignModels();
|
|
287
|
+
}
|
|
288
|
+
|
|
282
289
|
if (!this.elementsContainer.children.length) {
|
|
283
290
|
requestAnimationFrame(() => this._resizeHandler());
|
|
284
291
|
}
|
|
@@ -379,6 +386,11 @@ export class IronListAdapter {
|
|
|
379
386
|
toggleScrollListener() {}
|
|
380
387
|
|
|
381
388
|
_scrollHandler() {
|
|
389
|
+
// The scroll target is hidden.
|
|
390
|
+
if (this.scrollTarget.offsetHeight === 0) {
|
|
391
|
+
return;
|
|
392
|
+
}
|
|
393
|
+
|
|
382
394
|
this._adjustVirtualIndexOffset(this._scrollTop - (this.__previousScrollTop || 0));
|
|
383
395
|
const delta = this.scrollTarget.scrollTop - this._scrollPosition;
|
|
384
396
|
|