Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Page scroll resets to top when switching to medicines tab #6765

Closed
rithviknishad opened this issue Dec 1, 2023 · 4 comments · Fixed by #6825
Closed

Page scroll resets to top when switching to medicines tab #6765

rithviknishad opened this issue Dec 1, 2023 · 4 comments · Fixed by #6825
Assignees
Labels
bug Something isn't working

Comments

@rithviknishad
Copy link
Member

Describe the bug
Page scroll resets to top when switching to medicines tab

To Reproduce
Steps to reproduce the behavior:

  1. Go to a consultation dashboard
  2. Scroll down a bit
  3. Switch to medicines tab.

Expected behavior
When we switch tabs in the consultation dashboard, page scroll should not be reset for any tabs (except Feed tab where it scrolls to fit feed in view).

Screenshots
image

@rithviknishad rithviknishad added the bug Something isn't working label Dec 1, 2023
@github-project-automation github-project-automation bot moved this to Triage in Care Dec 1, 2023
@rithviknishad rithviknishad moved this from Triage to Up Next in Care Dec 1, 2023
@AshrafMd-1
Copy link
Contributor

I want to work on this issue. Can you assign this to me?

@AshrafMd-1
Copy link
Contributor

@rithviknishad for some reason this happens like randomly
sometimes it happens and sometimes it doesn't
I feel like this is due to the fact that before loading of data there is empty space due to which the whole page height becomes small making it to scroll top

@AshrafMd-1
Copy link
Contributor

AshrafMd-1 commented Dec 7, 2023

like this happens for all tabs when the loading screen is present or the data is small it suddenly changes the scroll position as the page height becomes small

@rithviknishad
Copy link
Member Author

Maybe two workarounds together would help fix this:

  1. when we click on a tab, we should scroll such that the tab goes to the top of the screen instead of just preserving the current scroll position.
  2. Show <Loading /> component or any component that takes h-screen height until the actual content is loaded. if the content is shorter than h-screen we could fill it with whitespace for remaining vertical space? (Or in other words, place the content in a div that is min-h-screen)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants