Skip to content

fix(booker): prevent toggle button from unselecting when clicked again#28061

Closed
Shrey-Sutariya wants to merge 1 commit intocalcom:mainfrom
Shrey-Sutariya:fix/booker-page-view-button
Closed

fix(booker): prevent toggle button from unselecting when clicked again#28061
Shrey-Sutariya wants to merge 1 commit intocalcom:mainfrom
Shrey-Sutariya:fix/booker-page-view-button

Conversation

@Shrey-Sutariya
Copy link
Contributor

What does this PR do?

This PR fixes an issue in the Booker layout toggle where clicking the same button again would unset the selection (aria-checked became false).The layout should remain selected unless a different option is chosen.

Visual Demo (For contributors especially)

After_ViewToggle.mp4

Fixes :

  • Make Radix ToggleGroup Controlled by adding value={layout} in ToggleGroup.Root

Mandatory Tasks (DO NOT REMOVE)

  • I have self-reviewed the code (A decent size PR without self-review might be rejected).
  • I have updated the developer docs in /docs if this PR makes changes that would require a documentation change. If N/A, write N/A here and check the checkbox.
  • I confirm automated tests are in place that prove my fix is effective or that my feature works.

Checklist

  • I haven't read the contributing guide
  • My code doesn't follow the style guidelines of this project
  • I haven't commented my code, particularly in hard-to-understand areas
  • I haven't checked if my changes generate no new warnings
  • My PR is too large (>500 lines or >10 files) and should be split into smaller PRs

@Shrey-Sutariya Shrey-Sutariya requested review from a team as code owners February 19, 2026 05:45
@graphite-app graphite-app bot added the community Created by Linear-GitHub Sync label Feb 19, 2026
@github-actions github-actions bot added the 🐛 bug Something isn't working label Feb 19, 2026
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 2 files

Prompt for AI agents (all issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="packages/ui/components/form/toggleGroup/ToggleGroup.tsx">

<violation number="1" location="packages/ui/components/form/toggleGroup/ToggleGroup.tsx:54">
P2: `value={layout}` overrides any caller-provided `value` prop. Existing ToggleGroup usages pass `value` for controlled behavior, but this change replaces it with `layout` (often undefined), causing selection state to stop reflecting caller state.</violation>
</file>

Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.

<RadixToggleGroup.Root
type="single"
{...props}
value={layout}
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: value={layout} overrides any caller-provided value prop. Existing ToggleGroup usages pass value for controlled behavior, but this change replaces it with layout (often undefined), causing selection state to stop reflecting caller state.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At packages/ui/components/form/toggleGroup/ToggleGroup.tsx, line 54:

<comment>`value={layout}` overrides any caller-provided `value` prop. Existing ToggleGroup usages pass `value` for controlled behavior, but this change replaces it with `layout` (often undefined), causing selection state to stop reflecting caller state.</comment>

<file context>
@@ -42,13 +43,15 @@ export const ToggleGroup = ({
       <RadixToggleGroup.Root
         type="single"
         {...props}
+        value={layout}
         orientation={orientation}
         onValueChange={onValueChange}
</file context>
Fix with Cubic

Copy link
Member

@sahitya-chandra sahitya-chandra left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for your contribution but going with #27748

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working community Created by Linear-GitHub Sync size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Booker Page : View toggle button loses selected state when clicking the same option again

2 participants

Comments