@vaadin/component-base 24.6.7 → 24.6.9

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.6.7",
3
+ "version": "24.6.9",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -38,10 +38,10 @@
38
38
  "lit": "^3.0.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@vaadin/chai-plugins": "~24.6.7",
42
- "@vaadin/test-runner-commands": "~24.6.7",
41
+ "@vaadin/chai-plugins": "~24.6.9",
42
+ "@vaadin/test-runner-commands": "~24.6.9",
43
43
  "@vaadin/testing-helpers": "^1.1.0",
44
44
  "sinon": "^18.0.0"
45
45
  },
46
- "gitHead": "40cba12f8e3a45d0c1742cd43bafb4b88e3ae07a"
46
+ "gitHead": "d88d62759ed998a552531fd0709f58e60238d356"
47
47
  }
package/src/define.js CHANGED
@@ -13,7 +13,7 @@ function dashToCamelCase(dash) {
13
13
 
14
14
  const experimentalMap = {};
15
15
 
16
- export function defineCustomElement(CustomElement, version = '24.6.7') {
16
+ export function defineCustomElement(CustomElement, version = '24.6.9') {
17
17
  Object.defineProperty(CustomElement, 'version', {
18
18
  get() {
19
19
  return version;
@@ -50,7 +50,7 @@ export const SlotStylesMixin = dedupingMixin(
50
50
  * @protected
51
51
  */
52
52
  get slotStyles() {
53
- return {};
53
+ return [];
54
54
  }
55
55
 
56
56
  /** @protected */
@@ -180,6 +180,16 @@ export class IronListAdapter {
180
180
  }
181
181
  }
182
182
 
183
+ hostConnected() {
184
+ // Restore scroll position, which is reset when host is removed from DOM,
185
+ // since virtualizer doesn't re-render when adding it to the DOM again.
186
+ // If the scroll target isn't visible and its `offsetParent` is `null`, wait
187
+ // for the ResizeObserver to handle this case (hiding -> moving -> showing).
188
+ if (this.scrollTarget.offsetParent && this.scrollTarget.scrollTop !== this._scrollPosition) {
189
+ this.scrollTarget.scrollTop = this._scrollPosition;
190
+ }
191
+ }
192
+
183
193
  update(startIndex = 0, endIndex = this.size - 1) {
184
194
  const updatedElements = [];
185
195
  this.__getVisibleElements().forEach((el) => {
@@ -80,4 +80,13 @@ export class Virtualizer {
80
80
  flush() {
81
81
  this.__adapter.flush();
82
82
  }
83
+
84
+ /**
85
+ * Notifies the virtualizer about its host element connected to the DOM.
86
+ *
87
+ * @method hostConnected
88
+ */
89
+ hostConnected() {
90
+ this.__adapter.hostConnected();
91
+ }
83
92
  }