scrollTo function is broken
See original GitHub issueHello.
I have a project using React + Next, and I’ve recently updated to React 16 and Next 4.
And after this updates, react-scroll
stopped working. I’m not sure it’s related, but that’s the main change I’ve made recently.
I’m using v1.6.4
That’s how it’s setup:
import Scroll from 'react-scroll'
let Element = Scroll.Element
let scroller = Scroll.scroller
scrollTo = () => {
scroller.scrollTo('element', {
duration: 800,
delay: 0,
smooth: 'easeInOutQuart',
containerId: 'element'
})
}
<MainButton href="javascript:void(0)" onClick={this.scrollTo}>Click me</MainButton>
<Element id="element" name="element"></Element>
Any clues on why it’s not working? Thanks
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
ScrollTo() function is not working properly with sections
I have a series of sections on an application that I just finished developing. I'm using the scrollTo plugin for jQuery. It's always...
Read more >Window.scrollTo() - Web APIs | MDN
Window.scrollTo() scrolls to a particular set of coordinates in the document.
Read more >is $w().scrollTo() broken? | Velo by Wix
I'm trying to use $w("#myElement").scrollTo() but is doesn't work on my live site, works fine in preview. I've noticed a lot of people...
Read more >scrollTop is not working. - MSDN
I am getting the value in var "test" but in the endRequest function when i am putting back the value in the m.scrollTop,...
Read more >row().scrollTo() not working — DataTables forums
My function to load the table, initialize it, and scrollTo are all in the same function and look like below. I've even tried...
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
Having the same problem. ScrollTo as well as Link are both not working.
@podrivo what do you mean by “same lavel as trigger” what is trigger ?
@fisshy if you want this can fix it (at least it helped me)
In scroller.js line 75 add
Remove rest above related to
scrollOffset
For me this solution works but I don’t use containers but I think with this solution it doesn’t matter Please try to implement it somehow, I need this to work