[Drawer] RTL is broken in v5 with styled-components
See original GitHub issueCurrent Behavior 😯
While using styled-components
as an engine with RTL support, according to the guidelines
stylis-plugin-rtl
- body is set on direction rtl
- theme is set with direction: rtl
then the temporary Drawer comes from the wrong side.
reproduced here : https://codesandbox.io/s/temporarydrawer-material-demo-forked-qc14i?file=/index.js
try to click on the RIGHT / LEFT buttons.
Expected Behavior 🤔
the drawer comes out from the correct side
Steps to Reproduce 🕹
reproduced here : https://codesandbox.io/s/temporarydrawer-material-demo-forked-qc14i?file=/index.js
BTW, when using emotionjs as the styling engine the issue is not reproduced.
Your Environment 🌎
"@emotion/react": "latest",
"@material-ui/core": "5.0.0-alpha.27",
"@material-ui/icons": "5.0.0-alpha.27",
"@material-ui/styled-engine-sc": "^5.0.0-alpha.25",
"clsx": "latest",
"react": "latest",
"react-dom": "latest",
"styled-components": "5.2.1",
"stylis-plugin-rtl": "1.1.0"
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:11 (4 by maintainers)
Top Results From Across the Web
[Drawer] RTL is broken in v5 with styled-components #25336
Current Behavior While using styled-components as an engine with RTL support, according to the guidelines stylis-plugin-rtl body is set ...
Read more >Right-to-left - Material UI - MUI
Install the rtl plugin styled-components requires version 1. If you are using styled-components as a styled engine, make sure to install the correct...
Read more >MUI5 TextField not affected with the RTL direction
1 Answer 1 · 1. HTML : Make sure the dir attribute is set on the body, otherwise native components will break: ·...
Read more >React Navigation v5 + React Native Paper = ❤️
Avatar, Text and Switch from react-native-paper. DrawerContentScrollView component makes the drawer vertically scrollable and provides support ...
Read more >Announcing styled-components v5: Beast Mode - Medium
50% faster server-side rendering, 22% faster client-side rendering, 31% smaller bundle size, RTL support and no breaking changes!. EJ: Updated January ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
if you want the Drawer to come from the right side on a
rtl
page, set these props:the drawer animation will be correct. if you want it to come from the left side just opposite the props.
I fixed it by this code: