Open plffy opened 1 year ago
Basically, can we give an option to make Link/Button non-clickable?
Have you tried CSS for this?
a { pointer-events: none }
could potentially fix it
This will block all the actions on Link element. I still need the navigation to work onClick. I did the below changes to solve this:
` /*
offset and to
propsKeeping the navigation using default "to" props as optional solves the common problem of last Link element not getting active as the offset is now set differently for onClick and active state transition.
Please let me know if you see any issue with this approach
@fisshy Can we have this support added in the react-scroll? I am happy to raise a PR for this.
This will solve the use-case to set the state active some pixels before the element reaches top and at the same time bring the element to top when clicked.
This is the normal scroll behaviour we generally see in most of the websites.
Any update on this?
Your always free to make a PR for this, but I will have to try it out and make sure it doesn't break current behaviour.
I have explained the complete situation here - https://stackoverflow.com/questions/74753194/react-customise-react-scroll-behaviour.
Can we stop the navigation behaviour on click of Link/Button? I want to use onClick props to navigate to the desired element when clicked but at the same time the correct Link should get active when user scrolls using mouse.