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

dynamic spy value

Open marslan2037 opened this issue 4 years ago • 1 comments

I have a site where i have menu and submenu when menu item is clicked that have submenu, spy={true} works correctly when user scroll. But the issue is I have each section under if else condition, means when one menu item is clicked, display property for it will be true and other sections will hide. Everything is working correctly but I have little issue with spy property. When page load first time menu item is already displaying and first menu item is also true now when I click on second menu item it correctly take me to that section and highlight that menu and its submenu first element but submenu of first element is still have active class, it should not have active class because that section is not displaying. Can i add spy propertly dynamically so when second menu item is true spy property for submenu of first menu item become false ?

here you can see it live: https://testmystorespeed.herokuapp.com/5ecdcd99afbaa5001c297164

marslan2037 avatar May 27 '20 01:05 marslan2037

I think I understand the problem.

Couldn't you just override the active class if that section isnt active?

Our could you just rerender that section if that section wasnt active, so it would refresh that section.

Do the Links point to the same element?

Would be easier for me to help you, If I could see a plunkr demonstrating the issue.

fisshy avatar May 27 '20 05:05 fisshy