@vaadin/multi-select-combo-box 24.2.0-alpha10 → 24.2.0-alpha11

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.2.0-alpha10",
3
+ "version": "24.2.0-alpha11",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -37,17 +37,17 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "@polymer/polymer": "^3.0.0",
40
- "@vaadin/a11y-base": "24.2.0-alpha10",
41
- "@vaadin/combo-box": "24.2.0-alpha10",
42
- "@vaadin/component-base": "24.2.0-alpha10",
43
- "@vaadin/field-base": "24.2.0-alpha10",
44
- "@vaadin/input-container": "24.2.0-alpha10",
45
- "@vaadin/item": "24.2.0-alpha10",
46
- "@vaadin/lit-renderer": "24.2.0-alpha10",
47
- "@vaadin/overlay": "24.2.0-alpha10",
48
- "@vaadin/vaadin-lumo-styles": "24.2.0-alpha10",
49
- "@vaadin/vaadin-material-styles": "24.2.0-alpha10",
50
- "@vaadin/vaadin-themable-mixin": "24.2.0-alpha10"
40
+ "@vaadin/a11y-base": "24.2.0-alpha11",
41
+ "@vaadin/combo-box": "24.2.0-alpha11",
42
+ "@vaadin/component-base": "24.2.0-alpha11",
43
+ "@vaadin/field-base": "24.2.0-alpha11",
44
+ "@vaadin/input-container": "24.2.0-alpha11",
45
+ "@vaadin/item": "24.2.0-alpha11",
46
+ "@vaadin/lit-renderer": "24.2.0-alpha11",
47
+ "@vaadin/overlay": "24.2.0-alpha11",
48
+ "@vaadin/vaadin-lumo-styles": "24.2.0-alpha11",
49
+ "@vaadin/vaadin-material-styles": "24.2.0-alpha11",
50
+ "@vaadin/vaadin-themable-mixin": "24.2.0-alpha11"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@esm-bundle/chai": "^4.3.4",
@@ -59,5 +59,5 @@
59
59
  "web-types.json",
60
60
  "web-types.lit.json"
61
61
  ],
62
- "gitHead": "ca16b5f88b00ae05fb6d7c7e9874525048e389f0"
62
+ "gitHead": "a958207d5f6a09ca0e2dcf9f62194b3f92c8766a"
63
63
  }
@@ -160,33 +160,44 @@ class MultiSelectComboBoxInternal extends ComboBoxDataProviderMixin(ComboBoxMixi
160
160
  * @override
161
161
  */
162
162
  _onEnter(event) {
163
- this.__enterPressed = true;
163
+ if (this.opened) {
164
+ // Do not submit the surrounding form.
165
+ event.preventDefault();
166
+ // Do not trigger global listeners.
167
+ event.stopPropagation();
168
+
169
+ if (this.readonly) {
170
+ this.close();
171
+ } else {
172
+ // Keep selected item focused after committing on Enter.
173
+ const focusedItem = this.filteredItems[this._focusedIndex];
174
+ this._commitValue();
175
+ this._focusedIndex = this.filteredItems.indexOf(focusedItem);
176
+ }
177
+
178
+ return;
179
+ }
164
180
 
165
181
  super._onEnter(event);
166
182
  }
167
183
 
168
184
  /**
185
+ * Override Escape handler to not clear
186
+ * selected items when readonly.
187
+ * @param {!Event} event
169
188
  * @protected
170
189
  * @override
171
190
  */
172
- _closeOrCommit() {
191
+ _onEscape(event) {
173
192
  if (this.readonly) {
174
- this.close();
175
- return;
176
- }
177
-
178
- if (this.__enterPressed) {
179
- this.__enterPressed = null;
180
-
181
- // Keep selected item focused after committing on Enter.
182
- const focusedItem = this.filteredItems[this._focusedIndex];
183
- this._commitValue();
184
- this._focusedIndex = this.filteredItems.indexOf(focusedItem);
185
-
193
+ event.stopPropagation();
194
+ if (this.opened) {
195
+ this.close();
196
+ }
186
197
  return;
187
198
  }
188
199
 
189
- super._closeOrCommit();
200
+ super._onEscape(event);
190
201
  }
191
202
 
192
203
  /**
@@ -16,13 +16,13 @@ import type { ControllerMixinClass } from '@vaadin/component-base/src/controller
16
16
  import type { DelegateStateMixinClass } from '@vaadin/component-base/src/delegate-state-mixin.js';
17
17
  import type { ElementMixinClass } from '@vaadin/component-base/src/element-mixin.js';
18
18
  import type { ResizeMixinClass } from '@vaadin/component-base/src/resize-mixin.js';
19
+ import type { SlotStylesMixinClass } from '@vaadin/component-base/src/slot-styles-mixin.js';
19
20
  import type { ClearButtonMixinClass } from '@vaadin/field-base/src/clear-button-mixin.js';
20
21
  import type { FieldMixinClass } from '@vaadin/field-base/src/field-mixin.js';
21
22
  import type { InputConstraintsMixinClass } from '@vaadin/field-base/src/input-constraints-mixin.js';
22
23
  import type { InputControlMixinClass } from '@vaadin/field-base/src/input-control-mixin.js';
23
24
  import type { InputMixinClass } from '@vaadin/field-base/src/input-mixin.js';
24
25
  import type { LabelMixinClass } from '@vaadin/field-base/src/label-mixin.js';
25
- import type { SlotStylesMixinClass } from '@vaadin/field-base/src/slot-styles-mixin.js';
26
26
  import type { ValidateMixinClass } from '@vaadin/field-base/src/validate-mixin.js';
27
27
  import type { ThemableMixinClass } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
28
28
  import type { ThemePropertyMixinClass } from '@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js';
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.2.0-alpha10",
4
+ "version": "24.2.0-alpha11",
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.2.0-alpha10",
4
+ "version": "24.2.0-alpha11",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {