themesberg / themesberg/flowbite

Modal always opens at the top on mobile browsers and page remains at the top after closing

Open
#891 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
9.4k
Forks
862
PR merge metrics
No merged PRs in 30d

Description

Bug Description

When opening a modal on mobile browsers, the page always scrolls to the top. After closing the modal, the page remains at the top instead of returning to the previous scroll position.

Steps to Reproduce
  1. Open a Flowbite demo page on a mobile browser.
  2. Scroll down and open a modal.
  3. Observe that the page scrolls to the top as soon as the modal is opened.
  4. Close the modal.
  5. Observe that the page remains at the top and does not return to the previous scroll position.
Expected Behavior

When opening a modal, the page should remain at the current scroll position. After closing the modal, the page should return to its previous scroll position.

Actual Behavior

The page scrolls to the top when the modal is opened. After closing the modal, the page stays at the top and does not return to the previous position.

Environment
  • Browser: Safari, Chrome, Firefox on mobile devices
  • Operating System: iOS, Android
Additional Information

This issue significantly impacts user experience as users lose their place on the page after closing the modal.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue on a Flowbite demo page using a mobile Safari, Chrome, or Firefox browser, then locate the modal behavior responsible for page scrolling. Done means opening a modal preserves the current scroll position and closing it restores that position on iOS and Android.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.