react-scroll icon indicating copy to clipboard operation
react-scroll copied to clipboard

Not activating link

Open Yuripetusko opened this issue 8 years ago • 8 comments

In Helpers.js there's a code on line 75 which determines if link needs to be active. I added console log there like so

if(offsetY >= top && offsetY <= height && scroller.getActiveLink() != to) {
            console.log("yes", to)
            scroller.setActiveLink(to);

If I click a link and it scrolls to element top to bottom, then the value of "to" is wrong, but as I scroll just one pixel it is calling it again with correct "to" value. So my link doesn't get active class unless i scroll a little bit.

Surprisingly this is not the case when I am at the bottom of a page and scroll bottom to top by pressing on link

Yuripetusko avatar Sep 03 '15 15:09 Yuripetusko

interesting, will look into it

fisshy avatar Sep 04 '15 08:09 fisshy

Same issue here !

Alexandre-Herve avatar Jul 12 '16 09:07 Alexandre-Herve

Same here

erinmeyers88 avatar Aug 25 '16 20:08 erinmeyers88

Same issue here

a-omsk avatar Dec 08 '16 09:12 a-omsk

This problem still exists

cryptokoala4 avatar Mar 20 '17 07:03 cryptokoala4

turning smooth scrolling off fixes this for me

bion avatar Jun 09 '17 23:06 bion

still exists

thanhthao150 avatar Jan 13 '21 03:01 thanhthao150

The issue still exists. However, as somebody mentioned you can turn off smooth scrolling. Then, to get the smooth effect, you can add this at the top of your style sheet - html, body{ scroll-behavior : smooth }. Hope this helps

SHASWAT2000-loves-logic avatar Feb 03 '23 11:02 SHASWAT2000-loves-logic