Submit assist dev tools on enter (#17073)

This commit is contained in:
Bram Kragten 2023-06-28 16:48:32 +02:00 committed by GitHub
parent e2daa89941
commit ce88c594b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,6 +51,14 @@ class HaPanelDevAssist extends SubscribeMixin(LitElement) {
this._language = ev.detail.value;
}
private _handleKeyDown(e: KeyboardEvent) {
if (e.code !== "Enter" || e.shiftKey) {
return;
}
e.preventDefault();
this._parse();
}
private _textAreaInput(ev) {
const value = ev.target.value;
const valid = Boolean(value);
@ -130,6 +138,7 @@ class HaPanelDevAssist extends SubscribeMixin(LitElement) {
label="Sentences"
id="sentences-input"
@input=${this._textAreaInput}
@keydown=${this._handleKeyDown}
></ha-textarea>
</div>
<div class="card-actions">