Skip to content
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

Merged
merged 2 commits into from
Apr 25, 2024

Conversation

deatiger
Copy link
Collaborator

@deatiger deatiger commented Apr 25, 2024

#1605 の修正時の考慮漏れ

Check List (If️ you added new component in this PR)

  • Export the component in src/components/index.ts
  • Add example to .storybook/documents/Information/Samples/Samples.stories.tsx
  • Localize added component

Copy link

changeset-bot bot commented Apr 25, 2024

🦋 Changeset detected

Latest commit: 0e98cc9

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

This PR includes changesets to release 1 package
Name Type
ingred-ui Patch

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

Copy link

netlify bot commented Apr 25, 2024

Deploy Preview for ingred-ui ready!

Name Link
🔨 Latest commit 0e98cc9
🔍 Latest deploy log https://app.netlify.com/sites/ingred-ui/deploys/6629c1fc837fc30008ffd7b9
😎 Deploy Preview https://deploy-preview-1607--ingred-ui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

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) => {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

アコーディオン開閉の state 変更時に set する css 用の state をまとめて変更する関数にした。

Comment on lines 63 to 66
useEffect(() => {
setExpandedState(expanded);
setContentStyle(expanded);
}, [expanded]);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Controlled Accordion(アコーディオンの利用元で state を管理している場合)の初期値が反映されないようになっていたので修正した

@deatiger deatiger merged commit 86c70f7 into master Apr 25, 2024
3 checks passed
@deatiger deatiger deleted the fix-controlled-accordion branch April 25, 2024 02:40
@FluctMember FluctMember mentioned this pull request Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants