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

Add Right to Left support to Masonry #1070

Closed
bardiarastin opened this issue Apr 7, 2018 · 2 comments
Closed

Add Right to Left support to Masonry #1070

bardiarastin opened this issue Apr 7, 2018 · 2 comments

Comments

@bardiarastin
Copy link
Contributor

Hello,
i'm using this project for one of my projects which is in Farsi and RTL so i need masonry in right to left direction.

i've read a little bit of Masonry source code and figured out it's using position absolute + some top and left values to adjust elements, i was able to achieve this by switching left to right in

screenshot:
image

i'm not sure that this is a silly solution or it's okay, then if it is or you have better solution, i can make a PR for this for an additional prop called isRtl ❤️

@bvaughn
Copy link
Owner

bvaughn commented Apr 7, 2018

i can make a PR for this for an additional prop called isRtl

Property naming wise, I would suggest direction (defaults to "vertical" but can also be "horizontal").

You'd be welcome to submit a PR, including docs and tests. Depending on how much complexity it adds, I'll consider adding it to the library. 😄

@bardiarastin
Copy link
Contributor Author

bardiarastin commented Apr 8, 2018

I agree with you about naming, just wanted to demonstrate the main idea.
if we only call it direction the user might misunderstand which direction do we mean (direction in the row or column).
what if we call it rowDirection instead which defaults to ltr and can be rtl too.

<Masonry rowDirection="rtl" />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants