samedi 2 octobre 2021

weird behavior with scrollIntoView on my website

I'm just finishing my website made with react and typescript and I noticed weird behavior of my navbar. I use element.scrollIntoView to move screen to specific part of the website but sometimes it scrolls just a little bit down and that's it but in most of the cases it works just fine.

Website is live here:
https://neidz.github.io/photography_agency/

Part of the code responsible for scrolling is here:
https://github.com/Neidz/photography_agency/blob/master/src/Sections/Navbar/navbar.tsx

To replicate that behavior just click on any of the buttons in navigation at the top and it should happen in maybe 3 tries.




Aucun commentaire:

Enregistrer un commentaire