From 5c95fa65dd7d1f5dc8330f9d3e793ebeb17faae8 Mon Sep 17 00:00:00 2001 From: Florian Schweikert Date: Mon, 16 Feb 2026 13:45:16 +0100 Subject: [PATCH] Allow to start typing -0 in float field (#29665) Prevent replacing "-0" with "0" while typing --- src/components/ha-form/ha-form-float.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/ha-form/ha-form-float.ts b/src/components/ha-form/ha-form-float.ts index 5518c48158..8983e027f4 100644 --- a/src/components/ha-form/ha-form-float.ts +++ b/src/components/ha-form/ha-form-float.ts @@ -76,6 +76,11 @@ export class HaFormFloat extends LitElement implements HaFormElement { return; } + // Allow user to start typing a negative zero + if (rawValue === "-0") { + return; + } + if (rawValue !== "") { value = parseFloat(rawValue); if (isNaN(value)) {