mui / mui/material-ui

[Modal] RTL - Scrollbar and padding issue

Open
#23,489 7 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

scope: modal
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

The issue is about padding being added to the right side of the body instead left side for RTL.

  • The issue is present in the latest release.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior 😯

When modal opens in RTL (direction="rtl") there is visible content shift. It's not happening for the LTR because padding-right compensates it.

Expected Behavior 🤔

In RTL mode padding-left has to be set instead.

Steps to Reproduce 🕹

https://codesandbox.io/s/material-demo-forked-uklog?file=/index.js

Had an issue with the official template. I don't think it's somehow related to the styling rather the problem is in ModalManager that sets padding on the body

Steps:

  1. Configure RTL as per https://material-ui.com/guides/right-to-left/#right-to-left
  2. Make sure body has a scroll
  3. Create modal
  4. Validate the issue

Context 🔦

I am building an accessible app that requires RTL support and discover this issue.

Your Environment 🌎

Tech Version
Material-UI v4.11.0
React 17
Browser Chrome
TypeScript N/A
etc.

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 by reproducing the RTL case from the linked CodeSandbox, then inspect the ModalManager entry point mentioned in the issue. Verify the behavior with a scrollable body and an opened modal; done means RTL no longer causes a visible content shift while LTR behavior remains unchanged.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend, internationalization
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.