@vaadin/combo-box 22.0.5 → 22.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/combo-box",
3
- "version": "22.0.5",
3
+ "version": "22.0.8",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -33,23 +33,23 @@
33
33
  "dependencies": {
34
34
  "@open-wc/dedupe-mixin": "^1.3.0",
35
35
  "@polymer/polymer": "^3.0.0",
36
- "@vaadin/component-base": "^22.0.5",
37
- "@vaadin/field-base": "^22.0.5",
38
- "@vaadin/input-container": "^22.0.5",
39
- "@vaadin/item": "^22.0.5",
40
- "@vaadin/vaadin-lumo-styles": "^22.0.5",
41
- "@vaadin/vaadin-material-styles": "^22.0.5",
42
- "@vaadin/vaadin-overlay": "^22.0.5",
43
- "@vaadin/vaadin-themable-mixin": "^22.0.5"
36
+ "@vaadin/component-base": "^22.0.8",
37
+ "@vaadin/field-base": "^22.0.8",
38
+ "@vaadin/input-container": "^22.0.8",
39
+ "@vaadin/item": "^22.0.8",
40
+ "@vaadin/vaadin-lumo-styles": "^22.0.8",
41
+ "@vaadin/vaadin-material-styles": "^22.0.8",
42
+ "@vaadin/vaadin-overlay": "^22.0.8",
43
+ "@vaadin/vaadin-themable-mixin": "^22.0.8"
44
44
  },
45
45
  "devDependencies": {
46
46
  "@esm-bundle/chai": "^4.3.4",
47
- "@vaadin/dialog": "^22.0.5",
48
- "@vaadin/polymer-legacy-adapter": "^22.0.5",
47
+ "@vaadin/dialog": "^22.0.8",
48
+ "@vaadin/polymer-legacy-adapter": "^22.0.8",
49
49
  "@vaadin/testing-helpers": "^0.3.2",
50
- "@vaadin/text-field": "^22.0.5",
50
+ "@vaadin/text-field": "^22.0.8",
51
51
  "lit": "^2.0.0",
52
52
  "sinon": "^9.2.0"
53
53
  },
54
- "gitHead": "3e1990867670f3de2dec6fa1200d945623b2710c"
54
+ "gitHead": "6b6a1e5262588ae0f0b056e133f196dc93177264"
55
55
  }
@@ -714,17 +714,21 @@ export const ComboBoxMixin = (subclass) =>
714
714
  // to prevent a repetitive input value being saved after pressing ESC and Tab.
715
715
  !itemMatchingByLabel
716
716
  ) {
717
+ const customValue = this._inputElementValue;
718
+
719
+ // Store reference to the last custom value for checking it on focusout.
720
+ this._lastCustomValue = customValue;
721
+
717
722
  // An item matching by label was not found, but custom values are allowed.
718
723
  // Dispatch a custom-value-set event with the input value.
719
724
  const e = new CustomEvent('custom-value-set', {
720
- detail: this._inputElementValue,
725
+ detail: customValue,
721
726
  composed: true,
722
727
  cancelable: true,
723
728
  bubbles: true
724
729
  });
725
730
  this.dispatchEvent(e);
726
731
  if (!e.defaultPrevented) {
727
- const customValue = this._inputElementValue;
728
732
  this._selectItemForValue(customValue);
729
733
  this.value = customValue;
730
734
  }
@@ -1062,6 +1066,13 @@ export const ComboBoxMixin = (subclass) =>
1062
1066
  return;
1063
1067
  }
1064
1068
  if (!this.readonly && !this._closeOnBlurIsPrevented) {
1069
+ // User's logic in `custom-value-set` event listener might cause input to blur,
1070
+ // which will result in attempting to commit the same custom value once again.
1071
+ if (!this.opened && this.allowCustomValue && this._inputElementValue === this._lastCustomValue) {
1072
+ delete this._lastCustomValue;
1073
+ return;
1074
+ }
1075
+
1065
1076
  this._closeOrCommit();
1066
1077
  }
1067
1078
  }