@vaadin/component-base 23.2.0-alpha5 → 23.2.0-beta2

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/component-base",
3
- "version": "23.2.0-alpha5",
3
+ "version": "23.2.0-beta2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -42,5 +42,5 @@
42
42
  "@vaadin/testing-helpers": "^0.3.2",
43
43
  "sinon": "^13.0.2"
44
44
  },
45
- "gitHead": "c6247fd741d61096d75a71feda4a1faf88b6f0ce"
45
+ "gitHead": "42864949ade7e573ac534a64ecdd97fab32a87fc"
46
46
  }
@@ -79,21 +79,18 @@ export const ActiveMixin = (superclass) =>
79
79
 
80
80
  if (this._shouldSetActive(event) && this._activeKeys.includes(event.key)) {
81
81
  this._setActive(true);
82
- }
83
- }
84
-
85
- /**
86
- * Removes the `active` attribute from the element if the activation key is released.
87
- *
88
- * @param {KeyboardEvent} event
89
- * @protected
90
- * @override
91
- */
92
- _onKeyUp(event) {
93
- super._onKeyUp(event);
94
82
 
95
- if (this._activeKeys.includes(event.key)) {
96
- this._setActive(false);
83
+ // Element can become hidden before the `keyup` event, e.g. on button click.
84
+ // Use document listener to ensure `active` attribute is removed correctly.
85
+ document.addEventListener(
86
+ 'keyup',
87
+ (e) => {
88
+ if (this._activeKeys.includes(e.key)) {
89
+ this._setActive(false);
90
+ }
91
+ },
92
+ { once: true },
93
+ );
97
94
  }
98
95
  }
99
96
 
@@ -39,7 +39,7 @@ const registered = new Set();
39
39
  export const ElementMixin = (superClass) =>
40
40
  class VaadinElementMixin extends DirMixin(superClass) {
41
41
  static get version() {
42
- return '23.2.0-alpha5';
42
+ return '23.2.0-beta2';
43
43
  }
44
44
 
45
45
  /** @protected */
@@ -125,7 +125,11 @@ export class FocusTrapController {
125
125
  const step = backward ? -1 : 1;
126
126
  const currentIndex = this.__focusedElementIndex;
127
127
  const nextIndex = (focusableElements.length + currentIndex + step) % focusableElements.length;
128
- focusableElements[nextIndex].focus();
128
+ const element = focusableElements[nextIndex];
129
+ element.focus();
130
+ if (element.localName === 'input') {
131
+ element.select();
132
+ }
129
133
  }
130
134
 
131
135
  /**