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

How to activate last element when the viewport is smaller than 100vh?

Open ugnelis opened this issue 3 years ago • 7 comments

Hi,

I ran into a problem as I can't activate the last element. This occurs because the last element does not have a height of 100vh. In my case, I can't have the last section 100vh.

Also, I have noticed that this issue has not been solved since 2016! (#161 #335 #396 #466)

Does anyone know how I can activate the last element when the viewport is smaller?

Best regards, Ugnius

ugnelis avatar Jan 31 '22 15:01 ugnelis

Yes, there's many issues like this. Could you provide a plunkr/codepen demonstrating your issue?

There might be ways to come around it.

fisshy avatar Jan 31 '22 20:01 fisshy

Yes, there's many issues like this. Could you provide a plunkr/codepen demonstrating your issue?

There might be ways to come around it.

https://codesandbox.io/s/react-scroll-issue-wktg3?file=/src/App.tsx

ugnelis avatar Feb 01 '22 07:02 ugnelis

Hacky solution: https://codesandbox.io/s/react-scroll-issue-forked-pdczf?file=/src/App.tsx

ugnelis avatar Feb 01 '22 09:02 ugnelis

Hacky solution: https://codesandbox.io/s/react-scroll-issue-forked-pdczf?file=/src/App.tsx

Doesn't work with hash though. Any other workaround?

Agiothyella avatar Mar 13 '22 15:03 Agiothyella

Hacky solution: https://codesandbox.io/s/react-scroll-issue-forked-pdczf?file=/src/App.tsx

@ugnelis Thanks for the working solution. @fisshy Tell me please, when can this become part of the library itself? Just to display the list using map - I had to do something like this. Looks completely illegible.) image

WebDevMaster2016 avatar Feb 24 '23 00:02 WebDevMaster2016

@WebDevMaster2016 I am not a maintainer of this library, By the way, I have stopped using react-scroll because it is too buggy and unpredictable (e.g., random jumps). I had a lot of hard time using it properly. I have replaced react-scroll library with https://www.npmjs.com/package/react-ui-scrollspy in my projects

ugnelis avatar Feb 24 '23 06:02 ugnelis

@WebDevMaster2016 I am not a maintainer of this library, By the way, I have stopped using react-scroll because it is too buggy and unpredictable (e.g., random jumps). I had a lot of hard time using it properly. I have replaced react-scroll library with https://www.npmjs.com/package/react-ui-scrollspy in my projects

@ugnelis Oh, I'm sorry) I really did not see that you are only the author of the question, and not the maintainer of the library. I already edited my previous question) https://www.npmjs.com/package/react-ui-scrollspy - looks promising

WebDevMaster2016 avatar Feb 24 '23 12:02 WebDevMaster2016