use the correct inputmode (#13722)

This commit is contained in:
Bram Kragten 2022-09-13 20:53:19 +02:00 committed by GitHub
parent 23e5a47b3b
commit b3d64fc52a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -51,8 +51,9 @@ export class HaNumberSelector extends LitElement {
`
: ""}
<ha-textfield
inputMode="numeric"
pattern="[0-9]+([\\.][0-9]+)?"
.inputMode=${(this.selector.number.step || 1) % 1 !== 0
? "decimal"
: "numeric"}
.label=${this.selector.number.mode !== "box" ? undefined : this.label}
.placeholder=${this.placeholder}
class=${classMap({ single: this.selector.number.mode === "box" })}