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

Manually setting dangerouslySetExpanded scrolls to middle of the AccordionItem instead of to Top. Is there any way to control the scroll such that after setting dangerouslySetExpanded it opens the Accordion item and scrolls to Top of that item? #338

Open
quepayal opened this issue Nov 10, 2021 · 1 comment

Comments

@quepayal
Copy link

I found the way around by using the below but problem is that it first scrolls to the middle and then to the top which is not what we want.
document.getElementById('AccordionItem1')?.scrollIntoView({ behavior: 'smooth' });

@holloway
Copy link

There's no scroll management in React-Accessible-Accordion, so any scrolling will be based on the user moving focus to an element which the browser then scrolls to.

Do you have a codepen/codesandbox example?

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

No branches or pull requests

2 participants