openedx / openedx/paragon

ModalDialog does not scroll into view on Chromium

Open
#4,430 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
JavaScript
Stars
140
Forks
100
Avg merge
1h 3m
Merged PRs (30d)
30

Description

The ModalDialog is expected to display in the centre of the viewport when open. In Firefox, this works fine: the modal is displayed overlaid over the centre of the page and the page is scrolled into view so the modal is in the centre of the viewport:

Image

However, in Chromium, it displays in the centre of the page, but it does not scroll into view. So if you are on a long page (eg. a unit with several components), and currently at the top or bottom of the page, the Modal appears off-screen, resulting in an unfriendly darkened page:

Image

The modal is visible if you manually scroll up, but this is not great UX.

To reproduce

  • create a unit with several components
  • for the first or last component, ensure it is one that lets you trigger a ModalDialog (not sure what else uses this; we're adding them to https://github.com/open-craft/xblock-ai-evaluation currently, which is a work in progress)
  • publish and view as a learner in Firefox
  • scroll up or down to the component, and trigger the modal
  • verify that the modal displays in the centre of the viewport
  • open the same page in Chromium and repeat triggering the modal
  • verify that the modal displays out of the viewport

Paragon version: @openedx/paragon@23.21.2

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

Start at the ModalDialog component and reproduce the issue using the steps in the report, comparing Firefox with Chromium on a long page. Done means opening the modal from a first or last component brings it into the centre of the Chromium viewport as it does in Firefox.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.