@vaadin/combo-box 23.1.0-beta3 → 23.1.0-beta4

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/combo-box",
3
- "version": "23.1.0-beta3",
3
+ "version": "23.1.0-beta4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -36,24 +36,24 @@
36
36
  "dependencies": {
37
37
  "@open-wc/dedupe-mixin": "^1.3.0",
38
38
  "@polymer/polymer": "^3.0.0",
39
- "@vaadin/component-base": "23.1.0-beta3",
40
- "@vaadin/field-base": "23.1.0-beta3",
41
- "@vaadin/input-container": "23.1.0-beta3",
42
- "@vaadin/item": "23.1.0-beta3",
43
- "@vaadin/lit-renderer": "23.1.0-beta3",
44
- "@vaadin/vaadin-lumo-styles": "23.1.0-beta3",
45
- "@vaadin/vaadin-material-styles": "23.1.0-beta3",
46
- "@vaadin/vaadin-overlay": "23.1.0-beta3",
47
- "@vaadin/vaadin-themable-mixin": "23.1.0-beta3"
39
+ "@vaadin/component-base": "23.1.0-beta4",
40
+ "@vaadin/field-base": "23.1.0-beta4",
41
+ "@vaadin/input-container": "23.1.0-beta4",
42
+ "@vaadin/item": "23.1.0-beta4",
43
+ "@vaadin/lit-renderer": "23.1.0-beta4",
44
+ "@vaadin/vaadin-lumo-styles": "23.1.0-beta4",
45
+ "@vaadin/vaadin-material-styles": "23.1.0-beta4",
46
+ "@vaadin/vaadin-overlay": "23.1.0-beta4",
47
+ "@vaadin/vaadin-themable-mixin": "23.1.0-beta4"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@esm-bundle/chai": "^4.3.4",
51
- "@vaadin/dialog": "23.1.0-beta3",
52
- "@vaadin/polymer-legacy-adapter": "23.1.0-beta3",
51
+ "@vaadin/dialog": "23.1.0-beta4",
52
+ "@vaadin/polymer-legacy-adapter": "23.1.0-beta4",
53
53
  "@vaadin/testing-helpers": "^0.3.2",
54
- "@vaadin/text-field": "23.1.0-beta3",
54
+ "@vaadin/text-field": "23.1.0-beta4",
55
55
  "lit": "^2.0.0",
56
56
  "sinon": "^13.0.2"
57
57
  },
58
- "gitHead": "c787ceb8a312f88631c6d429ff320d5f89b1b838"
58
+ "gitHead": "06e283473964ecb3085aacf3eddb5333d052a045"
59
59
  }
@@ -971,19 +971,15 @@ export const ComboBoxMixin = (subclass) =>
971
971
  this._selectItemForValue(this.value);
972
972
  }
973
973
 
974
- // Do not update `_focusedIndex` to from `-1` to old value during scroll.
975
- // Otherwise, the scroll would jump back to the previously focused item.
976
- if (!this.loading) {
977
- const inputValue = this._inputElementValue;
978
- if (inputValue === undefined || inputValue === this._getItemLabel(this.selectedItem)) {
979
- // When the input element value is the same as the current value or not defined,
980
- // set the focused index to the item that matches the value.
981
- this._focusedIndex = this.$.dropdown.indexOfLabel(this._getItemLabel(this.selectedItem));
982
- } else {
983
- // When the user filled in something that is different from the current value = filtering is enabled,
984
- // set the focused index to the item that matches the filter query.
985
- this._focusedIndex = this.$.dropdown.indexOfLabel(this.filter);
986
- }
974
+ const inputValue = this._inputElementValue;
975
+ if (inputValue === undefined || inputValue === this._getItemLabel(this.selectedItem)) {
976
+ // When the input element value is the same as the current value or not defined,
977
+ // set the focused index to the item that matches the value.
978
+ this._focusedIndex = this.$.dropdown.indexOfLabel(this._getItemLabel(this.selectedItem));
979
+ } else {
980
+ // When the user filled in something that is different from the current value = filtering is enabled,
981
+ // set the focused index to the item that matches the filter query.
982
+ this._focusedIndex = this.$.dropdown.indexOfLabel(this.filter);
987
983
  }
988
984
  }
989
985
  }
@@ -259,7 +259,9 @@ export class ComboBoxScroller extends PolymerElement {
259
259
  this.requestContentUpdate();
260
260
  }
261
261
 
262
- if (index >= 0) {
262
+ // Do not jump back to the previously focused item while loading
263
+ // when requesting next page from the data provider on scroll.
264
+ if (index >= 0 && !this.loading) {
263
265
  this.scrollIntoView(index);
264
266
  }
265
267
  }