I’ve been doing a Portfolio for myself, using React JS and I’ve been dealing with this issue it’s bothering me because I have a piece of text that I use as a logo when that piece of text is clicked, it sends the user back to the top of the page.
But the issue is that the button works but doesn’t send the user back to the top and leaves a bit of that space. I can’t explain it well and I’m sorry in case you don’t understand my issue but I’ll upload a picture of what happens when I click the text.
I wasn’t able to take a full screenshot but as u guys can see from the sidebar there’s still a bit that u can go up and I wanted to know what I could do to solve this issue.
I’ll put here too a link to the repository of the project so you guys can see the code overall and maybe give me a solution for my issue.. (I’m also having an issue with responsiveness that when the size of the browser is in half I have a sidebar but horizontal too).
I’m sorry btw if you guys can’t understand the overall problem, I’m kinda new to React JS and Web Dev and I’m struggling a bit to get everything in my head and understand this..
2
Answers
After seeing both of the answers I got I managed to change my js to make it work.
I'll leave what I've done to solve the issue and I'm gonna end this post, thanks again for the help on answering the question
}
You have put the
Navbar
component which is ahead ofHomeSection
and the scroll sets to onlyHomeSection
… If you include theNavBar
inside theHomeSection
that should work as expected..I mean keep as below
Remove from
App.js
asAlso you could do with the css hack as per the comment …