-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Bug]: Flicker in AccordionItem children #9818
Comments
Sandbox with issue. Click button , no flicker. Click header, flicker Sandbox of 7.25 No flicker issue Possible reason: |
will this ever be fixed? 😢 |
To provide some context, this hasn't been addressed yet because it's lower priority. It's a cosmetic rendering issue that doesn't block the user from being able to open or close the accordion item. Despite our best efforts every sprint, we can't get to every bug and some languish like this. I agree it's an eyesore and would like to see it fixed. PRs are always welcome! There's some proposed solutions above that would make sense for someone to put into a PR to test out and review if interested. |
Any movement on this issue? |
@Kilian-Collender no work has been done on this issue, but we'd welcome a PR if you have a fix in mind. |
I wanted to explore this issue but the moment I open storybook I get this error I'm following all the steps in the CONTRIBUTING.md but the moment I try to run the development server I get those errors, I'm not sure what is wrong |
@cesardlinx ensure you've run |
Hey @tw15egan thank you so much for your reply!. Yeah that was the first thing that I did but it didn't work, turns out that the one to blame was the OS, I was trying to run it on Windows and accordingly to this discussion #11042 thread there are extra steps in order to make it run on windows. But good news is that I switched to Linux and it runs smoothly! :D. I think we should consider to add that to the CONTRIBUTING.md. Now talking about the issue, I was testing the component and it looks like this issue was already solved some time ago, I wasn't able to see any flickering, the component goes fine, only whenever I change line 151 of AccordionItem.tsx from this: |
@cesardlinx which version did you try. I just tested with the original example using the latest stackblitz and I can still see the flashing https://stackblitz.com/edit/github-zzfu6s?file=src%2FApp.jsx |
Removes the flickering effect when using AccordionItem as a controlled component Closes carbon-design-system#9818
Removes the flickering effect when using AccordionItem as a controlled component Closes carbon-design-system#9818
Thank you @Kilian-Collender for taking the time and for sharing that stackblitz example. Yeah! you're totally right, it helped me reproduce the problem and find the issue. Basically the flickering was only present the moment we were using it as a controlled component, but now it's fixed! :D. Here is my PR #14776 |
Removes the flickering effect when using AccordionItem as a controlled component Closes carbon-design-system#9818
Removes the flickering effect when using AccordionItem as a controlled component
Removes the flickering effect when using AccordionItem as a controlled component
Removes the flickering effect when using AccordionItem as a controlled component
* fix: remove flicker in AccordionItem (#9818) Removes the flickering effect when using AccordionItem as a controlled component * fix: rework accordion component animation (#9818) * refactor: use ref hook for accordion content * test: update accordion component snapshots * docs: fix extra missing curly brace in .all-contributorsrc * docs: remove accordion controlled test story --------- Co-authored-by: Andrea N. Cardona <[email protected]> Co-authored-by: Alison Joseph <[email protected]>
…bon-design-system#14776) * fix: remove flicker in AccordionItem (carbon-design-system#9818) Removes the flickering effect when using AccordionItem as a controlled component * fix: rework accordion component animation (carbon-design-system#9818) * refactor: use ref hook for accordion content * test: update accordion component snapshots * docs: fix extra missing curly brace in .all-contributorsrc * docs: remove accordion controlled test story --------- Co-authored-by: Andrea N. Cardona <[email protected]> Co-authored-by: Alison Joseph <[email protected]>
Package
carbon-components-react
Browser
Chrome
Package version
7.45.0
Description
We have a requirement to persist the Accordion state while navigating through the application, thus kept the expand/collapsed state in the redux store. After upgrading from v7.26.0 where it worked with no issues it started blinking when being expanded or collapsed (see screen recording attached):
Screen.Recording.2021-10-07.at.21.51.37.mov
While checking on the AccordionItem sources I noticed that changing the condition from
to
resolves the issue.
CodeSandbox example
https://codesandbox.io/s/recursing-feather-4mglx?file=/src/index.js
Steps to reproduce
Just pass the open property and update it whenever an item is expanded/collapsed.
Code of Conduct
The text was updated successfully, but these errors were encountered: