scrollTo element name does not scroll exactly to element
See original GitHub issuedocument.getElementById(id).scrollIntoView();
works perfectly but scroller.scrollTo(id, { containerId: 'container' })
scrolls slightly above and I cannot correct it with offset because the mismatch is not fixed (ie. difference between correct position and scrolledPosition varies).
my Element
s are .map()
ped like with following render()
: <Element name={doc._id} id={doc._id}>content</Element>
.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:4
- Comments:7 (1 by maintainers)
Top Results From Across the Web
How do I scroll to an element using JavaScript? - Stack Overflow
Chrome (WebKit) has a bug which causes the page not to scroll once the anchor is set. Use: location.href="#";location.href="#myDiv" . Using id=" ...
Read more >Element.scrollTop - Web APIs | MDN
The Element.scrollTop property gets or sets the number of pixels that an element's content is scrolled vertically.
Read more >HTML DOM Element scrollTop Property - W3Schools
The number of pixels the element's content is scrolled vertically. If the number is negative, the number is set to 0. If the...
Read more >How to Scroll into view in Selenium Webdriver
It was a little challenging to scroll for each element. In Selenium we can do this with scrollIntoView(true) which can scroll automatically till ......
Read more >Scroll a React component into view - Robin van der Vleuten
scrollIntoView() . Which does exactly what it says it does with a few nice options to modify its behavior. Scroll to element with...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Had this issue aswell in the current version. Thanks to the code in the linked PR I figured out that I needed to set
position: relative
on the container.Feel free to make a PR, I Haven’t had the time to fix this yet.