fix(booker): prevent toggle button from unselecting when clicked again#28061
Closed
Shrey-Sutariya wants to merge 1 commit intocalcom:mainfrom
Closed
fix(booker): prevent toggle button from unselecting when clicked again#28061Shrey-Sutariya wants to merge 1 commit intocalcom:mainfrom
Shrey-Sutariya wants to merge 1 commit intocalcom:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
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} |
Contributor
There was a problem hiding this comment.
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>
Member
sahitya-chandra
left a comment
There was a problem hiding this comment.
thanks for your contribution but going with #27748
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 :
Mandatory Tasks (DO NOT REMOVE)
Checklist