[Modal] RTL - Scrollbar and padding issue
Nobody has claimed this yet.
- 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:
- Configure RTL as per https://material-ui.com/guides/right-to-left/#right-to-left
- Make sure body has a scroll
- Create modal
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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