From 4a580707ca25cf7c4cfb05d9d24775eded35311c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tao=20Bojl=C3=A9n?= Date: Sat, 20 Jun 2026 10:19:03 +0100 Subject: [PATCH] fix(docs): give each radio_group example a distinct field name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Native radios group by name across the whole document, and arrow-key navigation spans the group — so three demos all named "plan" became one group (and had colliding ids). Use distinct names (plan/tier/billing) per example. Document the constraint in the component moduledoc. Co-Authored-By: Claude Opus 4.8 (1M context) --- lib/shadix/components/radio_group.ex | 4 ++++ priv/registry/radio_group.json | 2 +- website/components/docs/radio_group.ex | 24 ++++++++++++++---------- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/lib/shadix/components/radio_group.ex b/lib/shadix/components/radio_group.ex index 3717461..a022d3f 100644 --- a/lib/shadix/components/radio_group.ex +++ b/lib/shadix/components/radio_group.ex @@ -12,6 +12,10 @@ defmodule Shadix.Components.RadioGroup do groups them); the selected dot is a CSS `before:` pseudo-element shown on `:checked`. No JavaScript. + Because grouping (and arrow-key navigation) is the browser's native behaviour over the + `name` attribute, **each distinct radio group on a page must use a distinct field name**. + Two groups backed by the same field name become one group for keyboard navigation. + Styling is colocated (`priv/styles/