Did not think of scroillIntoView. I think it is better to use rather than using offsetTop. I have already updated the PR with this sugesstion.