@vaadin/multi-select-combo-box 24.5.5 → 24.5.7

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/multi-select-combo-box",
3
- "version": "24.5.5",
3
+ "version": "24.5.7",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -38,21 +38,21 @@
38
38
  ],
39
39
  "dependencies": {
40
40
  "@polymer/polymer": "^3.0.0",
41
- "@vaadin/a11y-base": "~24.5.5",
42
- "@vaadin/combo-box": "~24.5.5",
43
- "@vaadin/component-base": "~24.5.5",
44
- "@vaadin/field-base": "~24.5.5",
45
- "@vaadin/input-container": "~24.5.5",
46
- "@vaadin/item": "~24.5.5",
47
- "@vaadin/lit-renderer": "~24.5.5",
48
- "@vaadin/overlay": "~24.5.5",
49
- "@vaadin/vaadin-lumo-styles": "~24.5.5",
50
- "@vaadin/vaadin-material-styles": "~24.5.5",
51
- "@vaadin/vaadin-themable-mixin": "~24.5.5"
41
+ "@vaadin/a11y-base": "~24.5.7",
42
+ "@vaadin/combo-box": "~24.5.7",
43
+ "@vaadin/component-base": "~24.5.7",
44
+ "@vaadin/field-base": "~24.5.7",
45
+ "@vaadin/input-container": "~24.5.7",
46
+ "@vaadin/item": "~24.5.7",
47
+ "@vaadin/lit-renderer": "~24.5.7",
48
+ "@vaadin/overlay": "~24.5.7",
49
+ "@vaadin/vaadin-lumo-styles": "~24.5.7",
50
+ "@vaadin/vaadin-material-styles": "~24.5.7",
51
+ "@vaadin/vaadin-themable-mixin": "~24.5.7"
52
52
  },
53
53
  "devDependencies": {
54
- "@vaadin/chai-plugins": "~24.5.5",
55
- "@vaadin/testing-helpers": "^1.0.0",
54
+ "@vaadin/chai-plugins": "~24.5.7",
55
+ "@vaadin/testing-helpers": "^1.1.0",
56
56
  "lit": "^3.0.0",
57
57
  "sinon": "^18.0.0"
58
58
  },
@@ -60,5 +60,5 @@
60
60
  "web-types.json",
61
61
  "web-types.lit.json"
62
62
  ],
63
- "gitHead": "864c93992c6466634ad47975dc6aceca3bbf8506"
63
+ "gitHead": "f04f4777d633ebf85368eb36545105b0e5b93731"
64
64
  }
@@ -150,6 +150,12 @@ class MultiSelectComboBoxInternal extends ComboBoxDataProviderMixin(ComboBoxMixi
150
150
  return 'vaadin-multi-select-combo-box';
151
151
  }
152
152
 
153
+ constructor() {
154
+ super();
155
+
156
+ this.addEventListener('custom-value-set', this.__onCustomValueSet.bind(this));
157
+ }
158
+
153
159
  /**
154
160
  * Override method inherited from the combo-box
155
161
  * to allow opening dropdown when readonly.
@@ -361,6 +367,19 @@ class MultiSelectComboBoxInternal extends ComboBoxDataProviderMixin(ComboBoxMixi
361
367
  }
362
368
  }
363
369
 
370
+ /**
371
+ * Override method inherited from the combo-box
372
+ * to not commit an already selected item again
373
+ * after closing overlay on outside click.
374
+ * @protected
375
+ * @override
376
+ */
377
+ _onClosed() {
378
+ this._ignoreCommitValue = true;
379
+
380
+ super._onClosed();
381
+ }
382
+
364
383
  /**
365
384
  * Override method inherited from the combo-box
366
385
  * to not commit an already selected item again
@@ -373,7 +392,7 @@ class MultiSelectComboBoxInternal extends ComboBoxDataProviderMixin(ComboBoxMixi
373
392
  this._ignoreCommitValue = false;
374
393
 
375
394
  // Reset internal combo-box state
376
- this.selectedItem = null;
395
+ this.clear();
377
396
  this._inputElementValue = '';
378
397
  return;
379
398
  }
@@ -442,6 +461,15 @@ class MultiSelectComboBoxInternal extends ComboBoxDataProviderMixin(ComboBoxMixi
442
461
 
443
462
  super.clearCache();
444
463
  }
464
+
465
+ /** @private */
466
+ __onCustomValueSet(event) {
467
+ // Prevent setting custom value on input blur or outside click,
468
+ // so it can be only committed explicitly by pressing Enter.
469
+ if (this._ignoreCommitValue) {
470
+ event.stopImmediatePropagation();
471
+ }
472
+ }
445
473
  }
446
474
 
447
475
  defineCustomElement(MultiSelectComboBoxInternal);
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/multi-select-combo-box",
4
- "version": "24.5.5",
4
+ "version": "24.5.7",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/multi-select-combo-box",
4
- "version": "24.5.5",
4
+ "version": "24.5.7",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {