acl-services / paprika

🌢 A robust + accessible UI component library for React applications by Galvanize.
MIT License
54 stars 9 forks source link

fix(CollapsibleCard): fix not controllable issue #1276

Closed allison-c closed 2 years ago

allison-c commented 2 years ago

Purpose πŸš€

fix CollapsibleCard not controllable issue https://aclgrc.atlassian.net/browse/UXD-2135

Notes ✏️

I know this is not a proper fix 😬
Basically the CollapsibleCard will expand/collapse every time when users click on the card header, even the prop isCollapsed doesn't change A proper fix might be always respecting the value of isCollapsed prop, if it's not null we just don't use the internal state. However that would be a major bump, it might break somewhere in our platform if the consumer uses isCollapsed

So I added some comments and example to demonstrate how to skip the internal state update. I've also checked with our designer, this use case won't be common anyway, we should always let the user expand/collapse the card. We can convert this PR to an issue if we don't want to fix.

Can be tested in the Controlled example here http://storybooks.highbond-s3.com/paprika/UXD-2133-fix-collapsible-card-not-controllable/?path=/story/navigation-collapsiblecard--controlled-and-uncontrolled

Updates πŸ“¦

If you have changed a component's source code (not stories, specs, or docs), before merging your branch run yarn changeset. This will prompt you to:

Storybook πŸ“•

http://storybooks.highbond-s3.com/paprika/UXD-2133-fix-collapsible-card-not-controllable

Screenshots πŸ“Έ

optional but highly recommended

References πŸ”—

relevant Jira ticket / GitHub issues

changeset-bot[bot] commented 2 years ago

πŸ¦‹ Changeset detected

Latest commit: a9774a98df4ec835456d03b1be6270cd2a3a503c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ------------------------- | ----- | | @paprika/collapsible-card | Minor |

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