@vaadin/component-base 25.2.3 → 25.2.5

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": "25.2.3",
3
+ "version": "25.2.5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -38,11 +38,11 @@
38
38
  "lit": "^3.0.0"
39
39
  },
40
40
  "devDependencies": {
41
- "@vaadin/chai-plugins": "~25.2.3",
42
- "@vaadin/test-runner-commands": "~25.2.3",
41
+ "@vaadin/chai-plugins": "~25.2.5",
42
+ "@vaadin/test-runner-commands": "~25.2.5",
43
43
  "@vaadin/testing-helpers": "^2.0.0",
44
44
  "sinon": "^22.0.0"
45
45
  },
46
46
  "customElements": "custom-elements.json",
47
- "gitHead": "3262084812870d48255afbd19b76fc8b1af32604"
47
+ "gitHead": "bfaf51d71619f34c0b00b326e6426f1cd9f7b2f5"
48
48
  }
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 = '25.2.3') {
16
+ export function defineCustomElement(CustomElement, version = '25.2.5') {
17
17
  Object.defineProperty(CustomElement, 'version', {
18
18
  get() {
19
19
  return version;
@@ -22,6 +22,7 @@ export class IronListAdapter {
22
22
  reorderElements,
23
23
  elementsContainer,
24
24
  __disableHeightPlaceholder,
25
+ __alwaysUpdateScrollerSize,
25
26
  }) {
26
27
  this.isAttached = true;
27
28
  this._vidxOffset = 0;
@@ -37,6 +38,12 @@ export class IronListAdapter {
37
38
  // elements with a non-zero height. Not for public use.
38
39
  this.__disableHeightPlaceholder = __disableHeightPlaceholder ?? false;
39
40
 
41
+ // Internal option: a predicate that, when it returns true, makes the scroller
42
+ // height always be applied instead of amortized (see `_updateScrollerSize`).
43
+ // Used by components whose height tracks the content exactly (e.g. the grid's
44
+ // `allRowsVisible` mode). Not for public use.
45
+ this.__alwaysUpdateScrollerSize = __alwaysUpdateScrollerSize;
46
+
40
47
  // Iron-list uses this value to determine how many pages of elements to render
41
48
  this._maxPages = 1.3;
42
49
 
@@ -88,7 +95,12 @@ export class IronListAdapter {
88
95
  if (this.reorderElements) {
89
96
  // Reordering the physical elements cancels the user's grab of the scroll bar handle on Safari.
90
97
  // Need to defer reordering until the user lets go of the scroll bar handle.
91
- this.scrollTarget.addEventListener('mousedown', () => {
98
+ this.scrollTarget.addEventListener('mousedown', (event) => {
99
+ // Only handle clicks on the scroll target itself
100
+ if (event.target !== this.scrollTarget) {
101
+ return;
102
+ }
103
+
92
104
  this.__mouseDown = true;
93
105
  });
94
106
  this.scrollTarget.addEventListener('mouseup', () => {
@@ -211,6 +223,11 @@ export class IronListAdapter {
211
223
  this.__afterElementsUpdated(updatedElements);
212
224
  }
213
225
 
226
+ /** @override */
227
+ _updateScrollerSize(forceUpdate) {
228
+ super._updateScrollerSize(forceUpdate || !!this.__alwaysUpdateScrollerSize?.());
229
+ }
230
+
214
231
  /**
215
232
  * Updates the height for a given set of items.
216
233
  *