@vaadin/multi-select-combo-box 23.1.3 → 23.1.4

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": "23.1.3",
3
+ "version": "23.1.4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -33,18 +33,18 @@
33
33
  ],
34
34
  "dependencies": {
35
35
  "@polymer/polymer": "^3.0.0",
36
- "@vaadin/combo-box": "^23.1.3",
37
- "@vaadin/component-base": "^23.1.3",
38
- "@vaadin/field-base": "^23.1.3",
39
- "@vaadin/input-container": "^23.1.3",
40
- "@vaadin/vaadin-lumo-styles": "^23.1.3",
41
- "@vaadin/vaadin-material-styles": "^23.1.3",
42
- "@vaadin/vaadin-themable-mixin": "^23.1.3"
36
+ "@vaadin/combo-box": "^23.1.4",
37
+ "@vaadin/component-base": "^23.1.4",
38
+ "@vaadin/field-base": "^23.1.4",
39
+ "@vaadin/input-container": "^23.1.4",
40
+ "@vaadin/vaadin-lumo-styles": "^23.1.4",
41
+ "@vaadin/vaadin-material-styles": "^23.1.4",
42
+ "@vaadin/vaadin-themable-mixin": "^23.1.4"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@esm-bundle/chai": "^4.3.4",
46
46
  "@vaadin/testing-helpers": "^0.3.2",
47
47
  "sinon": "^13.0.2"
48
48
  },
49
- "gitHead": "3066c296ad0ef652bc49417005523398199f1bf2"
49
+ "gitHead": "0a82302064f1276a000f0cbd810076539407d133"
50
50
  }
@@ -294,6 +294,11 @@ declare class MultiSelectComboBox<TItem = ComboBoxDefaultItem> extends HTMLEleme
294
294
  */
295
295
  clearCache(): void;
296
296
 
297
+ /**
298
+ * Clears the selected items.
299
+ */
300
+ clear(): void;
301
+
297
302
  /**
298
303
  * Requests an update for the content of items.
299
304
  * While performing the update, it invokes the renderer (passed in the `renderer` property) once an item.
@@ -196,7 +196,13 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
196
196
  ></vaadin-multi-select-combo-box-chip>
197
197
  <div id="chips" part="chips" slot="prefix"></div>
198
198
  <slot name="input"></slot>
199
- <div id="clearButton" part="clear-button" slot="suffix" aria-hidden="true"></div>
199
+ <div
200
+ id="clearButton"
201
+ part="clear-button"
202
+ slot="suffix"
203
+ on-touchend="_onClearButtonTouchend"
204
+ aria-hidden="true"
205
+ ></div>
200
206
  <div id="toggleButton" class="toggle-button" part="toggle-button" slot="suffix" aria-hidden="true"></div>
201
207
  </vaadin-multi-select-combo-box-container>
202
208
  </vaadin-multi-select-combo-box-internal>
@@ -496,6 +502,15 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
496
502
  return this.required && !this.readonly ? this._hasValue : true;
497
503
  }
498
504
 
505
+ /**
506
+ * Clears the selected items.
507
+ */
508
+ clear() {
509
+ this.__updateSelection([]);
510
+
511
+ announce(this.i18n.cleared);
512
+ }
513
+
499
514
  /**
500
515
  * Clears the cached pages and reloads data from data provider when needed.
501
516
  */
@@ -873,6 +888,14 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
873
888
  this._overflowItems = items;
874
889
  }
875
890
 
891
+ /** @private */
892
+ _onClearButtonTouchend(event) {
893
+ // Cancel the following click and focus events
894
+ event.preventDefault();
895
+
896
+ this.clear();
897
+ }
898
+
876
899
  /**
877
900
  * Override method inherited from `InputControlMixin` and clear items.
878
901
  * @protected
@@ -881,9 +904,7 @@ class MultiSelectComboBox extends ResizeMixin(InputControlMixin(ThemableMixin(El
881
904
  _onClearButtonClick(event) {
882
905
  event.stopPropagation();
883
906
 
884
- this.__updateSelection([]);
885
-
886
- announce(this.i18n.cleared);
907
+ this.clear();
887
908
  }
888
909
 
889
910
  /**