Repository navigation
fix: handle zero accordion group id - #5147
Open
bhumikabiyani wants to merge 1 commit into
Open
bhumikabiyani wants to merge 1 commit into
bhumikabiyani wants to merge 1 commit into
Conversation
|
Found potential problems with the pull request:
|
Author
|
Hi, I noticed the |
This branch has not been deployed
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.
Motivation
When using
List.AccordionGroupas a controlled component, passingexpandedId={0}causes the component to ignore the controlled ID and fall back to its internal state because0is treated as falsy. As a result, accordion items withid={0}fail to expand when controlled. This pull request ensures thatexpandedId={0}is respected as a valid controlled identifier.Related issue
Fixes #5144
Screenshots / Videos
N/A (logic bug fix; behavior is covered by automated regression tests).
Test plan
List.AccordionGroupwithexpandedId={0}and two accordions (id={0}andid={1}).id={0}renders as expanded with its children visible.id={1}renders as collapsed with its children hidden.expandedIddynamically to1and back to0, verifying that the active accordion switches accordingly.