question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@material-ui/styles RTL support

See original GitHub issue

Does the new ThemeProvider have full RTL support?

  • This is not a v0.x issue.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior 🤔

With RTL enabled TextFileds, including labels and placeholders, should be right aligned.

Current Behavior 😯

TextFileds seem left aligned screen shot 2019-01-23 at 10 17 41 am

Steps to Reproduce 🕹

https://codesandbox.io/s/wq787oxnml

Your Environment 🌎

Tech Version
Material-UI v3.9.0
Material-UI styles 3.0.0-alpha.8
React 16.8.0-alpha.1

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:18 (12 by maintainers)

github_iconTop GitHub Comments

15reactions
oliviertassinaricommented, Jul 2, 2019

@mbrevda Yes, it does:

import React from "react";
import ReactDOM from "react-dom";
import { createMuiTheme } from "@material-ui/core/styles";
import { StylesProvider, ThemeProvider, jssPreset } from "@material-ui/styles";
import { create } from "jss";
import rtl from "jss-rtl";
import Demo from "./demo";

const jss = create({ plugins: [...jssPreset().plugins, rtl()] });
const theme = createMuiTheme({
  direction: "rtl"
});

ReactDOM.render(
  <StylesProvider jss={jss}>
    <ThemeProvider theme={theme}>
      <Demo />
    </ThemeProvider>
  </StylesProvider>,
  document.querySelector("#root")
);

https://codesandbox.io/s/material-demo-3uhoj

capture d ecran 2019-01-23 a 12 01 58

~We will have to upgrade the RTL guide documentation with v4.~

6reactions
aminesicommented, Jul 23, 2019

Hi @oliviertassinari did you test your solution with typescript cause i get this error:

Argument of type ‘{ plugins: (Plugin | { onProcessStyle(style: any, rule: any, sheet: any): any; })[]; }’ is not assignable to parameter of type ‘Partial<JSSOptions>’. Types of property ‘plugins’ are incompatible. Type ‘(Plugin | { onProcessStyle(style: any, rule: any, sheet: any): any; })[]’ is not assignable to type ‘readonly JSSPlugin[]’. Type ‘Plugin | { onProcessStyle(style: any, rule: any, sheet: any): any; }’ is not assignable to type ‘JSSPlugin’. Type ‘Plugin’ is not assignable to type ‘JSSPlugin’. Index signature is missing in type ‘Plugin’

when i try to declare jss const. thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Right-to-left - Material UI - MUI
Right-to-left languages such as Arabic, Persian, or Hebrew are supported. To change the direction of MUI components you must follow the following steps....
Read more >
How to add RTL support for Material UI React - Stack Overflow
Material UI is using jss-rtl by default and this last one is a wrapper for rtl-css-js. So there is no need to use...
Read more >
material-ui/styles RTL support · Issue #14283 - GitHub
With RTL enabled TextFileds, including labels and placeholders, should be right aligned. Current Behavior. TextFileds seem left aligned
Read more >
RTL - Material Design
Material is an adaptable system of guidelines, components, and tools that support the best practices of user interface design. Backed by open-source code, ......
Read more >
How to add Localization (react-i18-next), and Right To Left ...
In case we need RTL support to material-ui components, there is extra steps that should be done. I will be following this tutorial...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found