@vaadin/combo-box 23.1.6 → 23.1.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 +13 -13
- package/src/vaadin-combo-box-scroller.js +33 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/combo-box",
|
|
3
|
-
"version": "23.1.
|
|
3
|
+
"version": "23.1.8",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -36,23 +36,23 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
38
|
"@polymer/polymer": "^3.0.0",
|
|
39
|
-
"@vaadin/component-base": "
|
|
40
|
-
"@vaadin/field-base": "
|
|
41
|
-
"@vaadin/input-container": "
|
|
42
|
-
"@vaadin/item": "
|
|
43
|
-
"@vaadin/lit-renderer": "
|
|
44
|
-
"@vaadin/vaadin-lumo-styles": "
|
|
45
|
-
"@vaadin/vaadin-material-styles": "
|
|
46
|
-
"@vaadin/vaadin-overlay": "
|
|
47
|
-
"@vaadin/vaadin-themable-mixin": "
|
|
39
|
+
"@vaadin/component-base": "~23.1.8",
|
|
40
|
+
"@vaadin/field-base": "~23.1.8",
|
|
41
|
+
"@vaadin/input-container": "~23.1.8",
|
|
42
|
+
"@vaadin/item": "~23.1.8",
|
|
43
|
+
"@vaadin/lit-renderer": "~23.1.8",
|
|
44
|
+
"@vaadin/vaadin-lumo-styles": "~23.1.8",
|
|
45
|
+
"@vaadin/vaadin-material-styles": "~23.1.8",
|
|
46
|
+
"@vaadin/vaadin-overlay": "~23.1.8",
|
|
47
|
+
"@vaadin/vaadin-themable-mixin": "~23.1.8"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@esm-bundle/chai": "^4.3.4",
|
|
51
|
-
"@vaadin/polymer-legacy-adapter": "
|
|
51
|
+
"@vaadin/polymer-legacy-adapter": "~23.1.8",
|
|
52
52
|
"@vaadin/testing-helpers": "^0.3.2",
|
|
53
|
-
"@vaadin/text-field": "
|
|
53
|
+
"@vaadin/text-field": "~23.1.8",
|
|
54
54
|
"lit": "^2.0.0",
|
|
55
55
|
"sinon": "^13.0.2"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "297e4e51743751bed97f5400e661529a7d550870"
|
|
58
58
|
}
|
|
@@ -90,6 +90,7 @@ export class ComboBoxScroller extends PolymerElement {
|
|
|
90
90
|
*/
|
|
91
91
|
selectedItem: {
|
|
92
92
|
type: Object,
|
|
93
|
+
observer: '__selectedItemChanged',
|
|
93
94
|
},
|
|
94
95
|
|
|
95
96
|
/**
|
|
@@ -245,7 +246,14 @@ export class ComboBoxScroller extends PolymerElement {
|
|
|
245
246
|
/** @private */
|
|
246
247
|
__loadingChanged(loading) {
|
|
247
248
|
if (this.__virtualizer && !loading) {
|
|
248
|
-
|
|
249
|
+
this.requestContentUpdate();
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/** @private */
|
|
254
|
+
__selectedItemChanged() {
|
|
255
|
+
if (this.__virtualizer) {
|
|
256
|
+
this.requestContentUpdate();
|
|
249
257
|
}
|
|
250
258
|
}
|
|
251
259
|
|
|
@@ -292,7 +300,7 @@ export class ComboBoxScroller extends PolymerElement {
|
|
|
292
300
|
|
|
293
301
|
el.setProperties({
|
|
294
302
|
item,
|
|
295
|
-
index
|
|
303
|
+
index,
|
|
296
304
|
label: this.getItemLabel(item),
|
|
297
305
|
selected: this.__isItemSelected(item, this.selectedItem, this.itemIdPath),
|
|
298
306
|
renderer: this.renderer,
|
|
@@ -309,6 +317,10 @@ export class ComboBoxScroller extends PolymerElement {
|
|
|
309
317
|
} else {
|
|
310
318
|
el.removeAttribute('theme');
|
|
311
319
|
}
|
|
320
|
+
|
|
321
|
+
if (item instanceof ComboBoxPlaceholder) {
|
|
322
|
+
this.__requestItemByIndex(index);
|
|
323
|
+
}
|
|
312
324
|
}
|
|
313
325
|
|
|
314
326
|
/** @private */
|
|
@@ -349,19 +361,29 @@ export class ComboBoxScroller extends PolymerElement {
|
|
|
349
361
|
}
|
|
350
362
|
|
|
351
363
|
/**
|
|
352
|
-
*
|
|
353
|
-
* the
|
|
364
|
+
* Dispatches an `index-requested` event for the given index to notify
|
|
365
|
+
* the data provider that it should start loading the page containing the requested index.
|
|
354
366
|
*
|
|
355
|
-
*
|
|
367
|
+
* The event is dispatched asynchronously to prevent an immediate page request and therefore
|
|
368
|
+
* a possible infinite recursion in case the data provider implements page request cancelation logic
|
|
369
|
+
* by invoking data provider page callbacks with an empty array.
|
|
370
|
+
* The infinite recursion may occur otherwise since invoking a data provider page callback with an empty array
|
|
371
|
+
* triggers a synchronous scroller update and, if the callback corresponds to the currently visible page,
|
|
372
|
+
* the scroller will synchronously request the page again which may lead to looping in the end.
|
|
373
|
+
* That was the case for the Flow counterpart:
|
|
374
|
+
* https://github.com/vaadin/flow-components/issues/3553#issuecomment-1239344828
|
|
356
375
|
*/
|
|
357
|
-
__requestItemByIndex(
|
|
358
|
-
|
|
376
|
+
__requestItemByIndex(index) {
|
|
377
|
+
requestAnimationFrame(() => {
|
|
359
378
|
this.dispatchEvent(
|
|
360
|
-
new CustomEvent('index-requested', {
|
|
379
|
+
new CustomEvent('index-requested', {
|
|
380
|
+
detail: {
|
|
381
|
+
index,
|
|
382
|
+
currentScrollerPos: this._oldScrollerPosition,
|
|
383
|
+
},
|
|
384
|
+
}),
|
|
361
385
|
);
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
return index;
|
|
386
|
+
});
|
|
365
387
|
}
|
|
366
388
|
|
|
367
389
|
/** @private */
|