Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTL issue in case manipulate Dom after boot #13706

Closed
soroushm opened this issue Nov 27, 2018 · 2 comments
Closed

RTL issue in case manipulate Dom after boot #13706

soroushm opened this issue Nov 27, 2018 · 2 comments
Labels
component: tabs This is the name of the generic UI component, not the React module! support: question Community support but can be turned into an improvement

Comments

@soroushm
Copy link

soroushm commented Nov 27, 2018

RTL issue after in case manipulate dir after boot

my application has multi lang so i use Helmet for change direction but there is some issues

for example tabs underling not updating and will be start in left side Like bellow:
https://codesandbox.io/s/ly9z85w259

7cceeeca-859b-431f-9e6b-b3f8f6dd2f06

Tech Version
Material-UI v3.6.0
React v16
@oliviertassinari oliviertassinari added support: question Community support but can be turned into an improvement component: tabs This is the name of the generic UI component, not the React module! labels Nov 27, 2018
@oliviertassinari
Copy link
Member

@soroushm This is a limitation of our implementation. We have been discussing it in #7187.
Now, we have been adding an API to handle the problem, you can find the action property in our documentation. https://material-ui.com/api/tabs/#props

  componentDidMount() {
    setTimeout(this.setState({ dir: true }), 200);
+   this.actions.updateIndicator();
  }
  render() {
    const { classes } = this.props;
    const jss = create({ plugins: [...jssPreset().plugins, rtl()] });
    const generateClassName = createGenerateClassName();
    return (
      <JssProvider jss={jss} generateClassName={generateClassName}>
        <MuiThemeProvider theme={theme}>
          <Helmet htmlAttributes={this.htmlAttr()}>
            <title>helmet</title>
            <meta name="description" content="Helmet application" />
          </Helmet>

          <Paper className={classes.root}>
            <Tabs
+             action={actions => (this.actions = actions)}
              value={this.state.value}
              onChange={this.handleChange}

https://codesandbox.io/s/9x5qo38j4

@soroushm
Copy link
Author

@oliviertassinari thanks buddy, your the best

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: tabs This is the name of the generic UI component, not the React module! support: question Community support but can be turned into an improvement
Projects
None yet
Development

No branches or pull requests

2 participants