mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Submit assist dev tools on enter (#17073)
This commit is contained in:
parent
e2daa89941
commit
ce88c594b7
@ -51,6 +51,14 @@ class HaPanelDevAssist extends SubscribeMixin(LitElement) {
|
|||||||
this._language = ev.detail.value;
|
this._language = ev.detail.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _handleKeyDown(e: KeyboardEvent) {
|
||||||
|
if (e.code !== "Enter" || e.shiftKey) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
e.preventDefault();
|
||||||
|
this._parse();
|
||||||
|
}
|
||||||
|
|
||||||
private _textAreaInput(ev) {
|
private _textAreaInput(ev) {
|
||||||
const value = ev.target.value;
|
const value = ev.target.value;
|
||||||
const valid = Boolean(value);
|
const valid = Boolean(value);
|
||||||
@ -130,6 +138,7 @@ class HaPanelDevAssist extends SubscribeMixin(LitElement) {
|
|||||||
label="Sentences"
|
label="Sentences"
|
||||||
id="sentences-input"
|
id="sentences-input"
|
||||||
@input=${this._textAreaInput}
|
@input=${this._textAreaInput}
|
||||||
|
@keydown=${this._handleKeyDown}
|
||||||
></ha-textarea>
|
></ha-textarea>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-actions">
|
<div class="card-actions">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user