@vaadin/component-base
Advanced tools
Comparing version 23.2.0-alpha5 to 23.2.0-alpha6
{ | ||
"name": "@vaadin/component-base", | ||
"version": "23.2.0-alpha5", | ||
"version": "23.2.0-alpha6", | ||
"publishConfig": { | ||
@@ -45,3 +45,3 @@ "access": "public" | ||
}, | ||
"gitHead": "c6247fd741d61096d75a71feda4a1faf88b6f0ce" | ||
"gitHead": "61f1fb56953434e97d34a8819640064301dd3d8a" | ||
} |
@@ -82,17 +82,14 @@ /** | ||
this._setActive(true); | ||
} | ||
} | ||
/** | ||
* Removes the `active` attribute from the element if the activation key is released. | ||
* | ||
* @param {KeyboardEvent} event | ||
* @protected | ||
* @override | ||
*/ | ||
_onKeyUp(event) { | ||
super._onKeyUp(event); | ||
if (this._activeKeys.includes(event.key)) { | ||
this._setActive(false); | ||
// Element can become hidden before the `keyup` event, e.g. on button click. | ||
// Use document listener to ensure `active` attribute is removed correctly. | ||
document.addEventListener( | ||
'keyup', | ||
(e) => { | ||
if (this._activeKeys.includes(e.key)) { | ||
this._setActive(false); | ||
} | ||
}, | ||
{ once: true }, | ||
); | ||
} | ||
@@ -99,0 +96,0 @@ } |
@@ -42,3 +42,3 @@ /** | ||
static get version() { | ||
return '23.2.0-alpha5'; | ||
return '23.2.0-alpha6'; | ||
} | ||
@@ -45,0 +45,0 @@ |
@@ -128,3 +128,7 @@ /** | ||
const nextIndex = (focusableElements.length + currentIndex + step) % focusableElements.length; | ||
focusableElements[nextIndex].focus(); | ||
const element = focusableElements[nextIndex]; | ||
element.focus(); | ||
if (element.localName === 'input') { | ||
element.select(); | ||
} | ||
} | ||
@@ -131,0 +135,0 @@ |
180107
5171