Add prefix support to text selector (#17335)

This commit is contained in:
Franck Nijhof 2023-07-18 11:57:20 +02:00 committed by GitHub
parent d7e58a00ca
commit bc3295d851
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 1 deletions

View File

@ -65,6 +65,7 @@ export class HaTextSelector extends LitElement {
.type=${this._unmaskedPassword ? "text" : this.selector.text?.type}
@input=${this._handleChange}
.label=${this.label || ""}
.prefix=${this.selector.text?.prefix}
.suffix=${this.selector.text?.type === "password"
? // reserve some space for the icon.
html`<div style="width: 24px"></div>`

View File

@ -329,6 +329,7 @@ export interface StringSelector {
| "time"
| "datetime-local"
| "color";
prefix?: string;
suffix?: string;
autocomplete?: string;
} | null;

View File

@ -122,7 +122,9 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) {
{
name: "id",
selector: {
text: {},
text: {
prefix: "script.",
},
},
},
] as const)