-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(TreeView): Fix invalid tree item children #1584
Conversation
🦋 Changeset detectedLatest commit: dbfccb5 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
works as intended, tested locally on /story/treeview--invalid-tree-items
MAST engineers checked this version and are no longer seeing this visual issue. |
Issue: none
What I did
MAST engineers reported a change in behavior from
4.6.0
to our prerelease. Items that had invalid children would get the expandable arrow when they shouldn't. In addition, I added unit tests so we don't break this accidentally in the future.Screenshots:
All examples with the same code:
In 4.6.0
![image](https://private-user-images.githubusercontent.com/91160746/388228551-693e4df0-7453-42da-aa09-ef0bec5ccace.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4Mzg5MjgsIm5iZiI6MTczOTgzODYyOCwicGF0aCI6Ii85MTE2MDc0Ni8zODgyMjg1NTEtNjkzZTRkZjAtNzQ1My00MmRhLWFhMDktZWYwYmVjNWNjYWNlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE4VDAwMzAyOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI2N2YxYzFlZWU1MjAwYmU3MTNjOWYwMGQxOWJiY2Q4NjI3NWI0ZjIzNTM5NDJjMGJiZDA3ZGY2NzhiNzhlMTEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.70LfHf8kM4TYqR_JcumXMlE2haj-FvV6xvLpESGtyD8)
In 4.7.0-next.50
![image](https://private-user-images.githubusercontent.com/91160746/388228694-8632f125-fe8c-47f9-b47d-d10ff8caaa77.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4Mzg5MjgsIm5iZiI6MTczOTgzODYyOCwicGF0aCI6Ii85MTE2MDc0Ni8zODgyMjg2OTQtODYzMmYxMjUtZmU4Yy00N2Y5LWI0N2QtZDEwZmY4Y2FhYTc3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE4VDAwMzAyOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThlN2EwOGU3Y2NkZDUwN2E4YjE5Y2U3YWQwNTA4OWQ3MDYxZGYxMmVlM2IwOGM1MDNjZTgyMjkyZWM1NzFkMDImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.bX7mdodkuaJi5TaXUFAtqfF2pNvRH-aT80p1iqacW80)
Update from this PR
![image](https://private-user-images.githubusercontent.com/91160746/388228895-e67623e5-9317-42c3-b519-218c2012d5d5.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk4Mzg5MjgsIm5iZiI6MTczOTgzODYyOCwicGF0aCI6Ii85MTE2MDc0Ni8zODgyMjg4OTUtZTY3NjIzZTUtOTMxNy00MmMzLWI1MTktMjE4YzIwMTJkNWQ1LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTglMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjE4VDAwMzAyOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI3YzQzZTc1NmFlYWFiZjBkMGYxZmZhYjg3OTZlNWUwYzg4YTMyMDFhNWFmNzZkNDFmZmQ5ZDlmZjE3MGUwNmQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.NSQKFPPxsmTq9LrqY97b4HmTy6iDnpCWp9ywLzH2pi0)
Checklist
How to test
Open CodeSandbox and try different kinds of tree structures. Ensure that the items that are expandable are the expected ones (ones with valid children, whether that's a single TreeItem or multiple).
Note: to test previous behavior, open CS and change the package version from 4.6.0 to the latest prerelease