Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

[Topics] Scroll to top not working when switching topics #1576

Open
christopherlim98 opened this issue Apr 18, 2022 · 1 comment
Open

[Topics] Scroll to top not working when switching topics #1576

christopherlim98 opened this issue Apr 18, 2022 · 1 comment

Comments

@christopherlim98
Copy link
Contributor

Describe the bug
As title says, scroll to top is not working when switching topics, thus resulting in a strange user experience.

Screenshots

Screen.Recording.2022-04-18.at.5.41.29.PM.mov
@roycehoe
Copy link

Hi there

I think I have found a solution to this issue. For the TopicCard.component.tsx on line 158, an additional block of code should be added so that, whenever a topic card is clicked, the entire page would scroll to the top.

This is the block of code that should be added:
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' })

Do let me know how I can create a pull request for this :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants