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

[data grid] Support RTL #230

Closed
6 tasks done
Tracked by #6130
oliviertassinari opened this issue Aug 29, 2020 · 14 comments · Fixed by #6580
Closed
6 tasks done
Tracked by #6130

[data grid] Support RTL #230

oliviertassinari opened this issue Aug 29, 2020 · 14 comments · Fixed by #6580
Labels
component: data grid This is the name of the generic UI component, not the React module! new feature New feature or request ready to take Help wanted. Guidance available. There is a high chance the change will be accepted umbrella For grouping multiple issues to provide a holistic view waiting for 👍 Waiting for upvotes

Comments

@oliviertassinari
Copy link
Member

oliviertassinari commented Aug 29, 2020

  • 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 😯

right-to-left is not supported

Expected Behavior 🤔

right-to-left is supported

Steps to Reproduce 🕹

Steps:

  1. https://material-ui-x.netlify.app/components/data-grid/pagination/
  2. Click on the right-to-left icon
  3. 💥

Capture d’écran 2020-08-29 à 17 58 22

Context 🔦

I think that we should wait for upvotes before taking on this task. It's not a frequent requirement.

Your Environment 🌎

Tech Version
Material-UI X v0.1.63
@oliviertassinari oliviertassinari added component: data grid This is the name of the generic UI component, not the React module! new feature New feature or request labels Aug 29, 2020
@oliviertassinari
Copy link
Member Author

oliviertassinari commented Sep 12, 2020

Based on https://npm-stat.com/charts.html?package=jss&package=jss-RTL&from=2021-09-17&to=2022-09-17 RTL is 2% of the global market share.

So it should probably be a low priority for the maintainers of this project.

Now, I think that it's typically why we are open source: if the community could work on a fix, it would be great. From my experience adding RTL support, it has never been really hard nor added a lot of bundlesize overhead, it's more that it has an opportunity cost.

@alii-7
Copy link

alii-7 commented Jul 23, 2021

@oliviertassinari This issue exists in version 5. Can it be be reopened to be fixed in v5?

@oliviertassinari
Copy link
Member Author

oliviertassinari commented Jul 23, 2021

@alii-7 the issue is open, per its status on GitHub.

@mbrookes
Copy link
Member

mbrookes commented Sep 1, 2021

Per the email from Amir Mohammad Tavakoli, the documentation appears to claim RTL support: https://material-ui.com/components/data-grid/localization/

@oliviertassinari
Copy link
Member Author

oliviertassinari commented Sep 1, 2021

appears to claim RTL support

@mbrookes True, it's referenced once in the header description. We can fix this, by being more explicit.

@flaviendelangle flaviendelangle added the ready to take Help wanted. Guidance available. There is a high chance the change will be accepted label Sep 9, 2021
@billyTepper

This comment was marked as duplicate.

@LironShirazi
Copy link

LironShirazi commented Jul 14, 2022

After many hours of trying a lot of things to fix it, I found a workaround for making the headers work correct with the data table of DataGrid, I just modified the direction of 2 classes to be ltr (assuming that the whole project is wrapped with RTL, in my case with 'stylis' and RTL plugin, using MUI V5).
I modified these classes via makeStyles function:

root: {
  '& .MuiDataGrid-columnsContainer': {
   direction: 'ltr'
  }
  '& .MuiDataGrid-virtualScroller': {
    direction: 'ltr',
  }
}

I hope it helps someone :)

@dashty94
Copy link

dashty94 commented Sep 12, 2022

@LironShirazi This solution #230 (comment)
is not working for me. Would you be too kind and share a working code example?

@dashty94 dashty94 mentioned this issue Sep 12, 2022
7 tasks
@alirezagh73

This comment was marked as resolved.

@ghasemi1994

This comment was marked as off-topic.

@ghasemi1994

This comment was marked as off-topic.

@yaredtsy
Copy link
Contributor

I have a simple workaround, you can check it out if it helps https://codesandbox.io/s/nice-frost-5vuf86?file=/demo.js.

@flaviendelangle flaviendelangle changed the title [DataGrid] Support RTL [data grid] Support RTL Oct 17, 2022
@yaredtsy yaredtsy mentioned this issue Oct 20, 2022
3 tasks
@yaredtsy
Copy link
Contributor

Hi @oliviertassinari
I have fixed this issue and submitted a PR #6580

@samislam
Copy link

Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! new feature New feature or request ready to take Help wanted. Guidance available. There is a high chance the change will be accepted umbrella For grouping multiple issues to provide a holistic view waiting for 👍 Waiting for upvotes
Projects
None yet
Development

Successfully merging a pull request may close this issue.