From 2de7fdde10c66ffdab6b312bc8dbd54726ec6363 Mon Sep 17 00:00:00 2001 From: Robin Date: Mon, 27 Jul 2026 17:37:57 +0200 Subject: [PATCH] Fix layout switches not showing their state on the combined docs page On the combined Storybook docs page for the call footer, the layout switches would not show the correct state until you hovered over them because they all shared the same input name and thus were interpreted as belonging to the same radio group. --- src/room/LayoutSwitch.tsx | 5 +++-- src/room/__snapshots__/InCallView.test.tsx.snap | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/room/LayoutSwitch.tsx b/src/room/LayoutSwitch.tsx index 80995a35c..91ba0654f 100644 --- a/src/room/LayoutSwitch.tsx +++ b/src/room/LayoutSwitch.tsx @@ -5,7 +5,7 @@ SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial Please see LICENSE in the repository root for full details. */ -import { type FC } from "react"; +import { useId, type FC } from "react"; import { SpotlightViewIcon, GridIcon, @@ -24,10 +24,11 @@ interface Props { export const LayoutSwitch: FC = ({ vm, className }) => { const { t } = useTranslation(); const layout = useBehavior(vm.layout$); + const name = useId(); return ( - name="layout" + name={name} aria-label={t("layout_switch_label")} leftLabel={t("layout_spotlight_label")} leftValue="spotlight" diff --git a/src/room/__snapshots__/InCallView.test.tsx.snap b/src/room/__snapshots__/InCallView.test.tsx.snap index 8a805668d..984e2b12e 100644 --- a/src/room/__snapshots__/InCallView.test.tsx.snap +++ b/src/room/__snapshots__/InCallView.test.tsx.snap @@ -432,8 +432,8 @@ exports[`InCallView > rendering > renders 1`] = ` data-size="lg" > @@ -452,9 +452,9 @@ exports[`InCallView > rendering > renders 1`] = ` />