From ce8074ad089c325d6c2d6bff86f16955de07e098 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Tue, 20 Oct 2026 13:03:12 +0200 Subject: [PATCH] fix(ui): keep a wrapped label's colon on its last word The label primitive was an inline flex box, so its ::after colon was a flex item of its own: when a long field name wrapped in a narrow column, the colon floated beside the whole text block instead of following the last word. The label now lays out inline and the colon wraps with the text. Call sites that set flex themselves keep their own layout. --- src/components/ui/__tests__/label.test.tsx | 36 ++++++++++++++++++++++ src/components/ui/label.tsx | 13 +++++++- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 src/components/ui/__tests__/label.test.tsx diff --git a/src/components/ui/__tests__/label.test.tsx b/src/components/ui/__tests__/label.test.tsx new file mode 100644 index 000000000..b2d12d8e7 --- /dev/null +++ b/src/components/ui/__tests__/label.test.tsx @@ -0,0 +1,36 @@ +import { describe, expect, it } from "vitest"; +import { renderToStaticMarkup } from "react-dom/server"; + +import { Label } from "../label"; + +describe("