react-accessible-accordion icon indicating copy to clipboard operation
react-accessible-accordion copied to clipboard

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?

Open quepayal opened this issue 2 years ago • 1 comments

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' });

quepayal avatar Nov 10 '21 10:11 quepayal

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?

holloway avatar Apr 20 '22 00:04 holloway