-
Notifications
You must be signed in to change notification settings - Fork 10
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
🐛 Controlled Accordion の初期値に対してアコーディオンが開かない #1607
Conversation
🦋 Changeset detectedLatest commit: 0e98cc9 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 |
✅ Deploy Preview for ingred-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
const handleChange = (event: React.SyntheticEvent, expanded: boolean) => { | ||
setExpandedState(expanded); | ||
onChange && onChange(event, expanded); | ||
const setContentStyle = (expanded: boolean) => { |
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.
アコーディオン開閉の state 変更時に set する css 用の state をまとめて変更する関数にした。
useEffect(() => { | ||
setExpandedState(expanded); | ||
setContentStyle(expanded); | ||
}, [expanded]); |
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.
Controlled Accordion(アコーディオンの利用元で state を管理している場合)の初期値が反映されないようになっていたので修正した
#1605 の修正時の考慮漏れ
Check List (If️ you added new component in this PR)
src/components/index.ts
.storybook/documents/Information/Samples/Samples.stories.tsx