I am using a Accordion type component that should scroll to the accordion body class minus the offset of accordion header.
Problem I have is when I trigger the accordion next click from the first accordion to the 2nd, the content is not matching the offset. It works if I set timout to 600ms instead of 300.
But then you get a weird effect of content expanding and page scrolling after.
Is there a good way of fixing the expanding of content and scrolling at the same time?
componentDidMount() {
setTimeout(() => {
scroller.scrollTo(this.props.scrollToId, {
duration: 500,
offset: -72,
smooth: false,
isDynamic: true // See no difference with this..
});
}, 300);
}
I am using a Accordion type component that should scroll to the accordion body class minus the offset of accordion header.
Problem I have is when I trigger the accordion next click from the first accordion to the 2nd, the content is not matching the offset. It works if I set timout to 600ms instead of 300. But then you get a weird effect of content expanding and page scrolling after.
Is there a good way of fixing the expanding of content and scrolling at the same time?