fisshy / react-scroll

React scroll component
https://github.com/fisshy/react-scroll/blob/master/README.md
MIT License
4.36k stars 437 forks source link

How to hightlight active link on last section smaller than viewport? #396

Open online0227 opened 5 years ago

online0227 commented 5 years ago

Hello.

Everything about setting active for the current section corresponding to the top menu as scrolling down works fine except the last section that is smaller than viewport.

If I give an offset to last element to highlight faster then the problem is that on the top menu it highlights both of last section and the one before the last one.

Can you give me some tips how to make this with this library?

fisshy commented 5 years ago

Hello,

Currently no support in this lib.

I usually put some margin/padding at the bottom.

online0227 commented 5 years ago

Thanks for response.I don't want to expand visible footer size so I may not do that.

az-iB commented 4 years ago

Hey, Any work around for this issu ?

pixelleaf commented 4 years ago

I'm currently facing the same problem. I've tried a few things, but nothing has solidified yet. Some advice would be amazing!

FrancoMuniz commented 3 years ago

Does anyone have a suggestion/workaround for this? Would be amazing, cause the last element becomes really annoying

rmanium commented 3 years ago

The fix shouldn't be too hard? if container is scrolled to bottom last item should become active? Wonder why this feature is not supported!

rmanium commented 3 years ago

Does anyone have a suggestion/workaround for this? Would be amazing, cause the last element becomes really annoying

A hacky solution for now could be to set a custom offset for the last item and manipulate the active class yourself

amand33p commented 3 years ago

Does anyone have a suggestion/workaround for this? Would be amazing, cause the last element becomes really annoying

A hacky solution for now could be to set a custom offset for the last item and manipulate the active class yourself

How to manipulate active class, exactly?

iraqwarvet31 commented 3 years ago

Having same issue unfortunately. Would be open to hacky solutions if they didn't involve changing the viewport