mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Make add integration dialog keyboard accessible (#23829)
Make add integration keyboard accessible
This commit is contained in:
parent
898fd51c7d
commit
7aa2abc9c2
@ -319,7 +319,6 @@ class AddIntegrationDialog extends LitElement {
|
||||
open
|
||||
@closed=${this.closeDialog}
|
||||
scrimClickAction
|
||||
escapeKeyAction
|
||||
hideActions
|
||||
.heading=${createCloseHeading(
|
||||
this.hass,
|
||||
@ -449,12 +448,14 @@ class AddIntegrationDialog extends LitElement {
|
||||
>
|
||||
<lit-virtualizer
|
||||
scroller
|
||||
tabindex="-1"
|
||||
class="ha-scrollbar"
|
||||
style=${styleMap({
|
||||
width: `${this._width}px`,
|
||||
height: this._narrow ? "calc(100vh - 184px)" : "500px",
|
||||
})}
|
||||
@click=${this._integrationPicked}
|
||||
@keypress=${this._handleKeyPress}
|
||||
.items=${integrations}
|
||||
.keyFunction=${this._keyFunction}
|
||||
.renderItem=${this._renderRow}
|
||||
@ -478,6 +479,7 @@ class AddIntegrationDialog extends LitElement {
|
||||
brand
|
||||
.hass=${this.hass}
|
||||
.integration=${integration}
|
||||
tabindex="0"
|
||||
>
|
||||
</ha-integration-list-item>
|
||||
`;
|
||||
@ -534,6 +536,12 @@ class AddIntegrationDialog extends LitElement {
|
||||
this._handleIntegrationPicked(listItem.integration);
|
||||
}
|
||||
|
||||
private _handleKeyPress(ev) {
|
||||
if (ev.key === "Enter") {
|
||||
this._integrationPicked(ev);
|
||||
}
|
||||
}
|
||||
|
||||
private async _handleIntegrationPicked(integration: IntegrationListItem) {
|
||||
if (integration.supported_by) {
|
||||
this._supportedBy(integration);
|
||||
|
Loading…
x
Reference in New Issue
Block a user