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?
quepayal opened this issue · 1 comments
quepayal commented
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 commented
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?