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

[Masonry] Ability to sort elements from left to right #36859

Closed
2 tasks done
Whitelistedd opened this issue Apr 12, 2023 · 7 comments · Fixed by #39904
Closed
2 tasks done

[Masonry] Ability to sort elements from left to right #36859

Whitelistedd opened this issue Apr 12, 2023 · 7 comments · Fixed by #39904
Assignees
Labels
component: masonry This is the name of the generic UI component, not the React module! new feature New feature or request waiting for 👍 Waiting for upvotes

Comments

@Whitelistedd
Copy link

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the latest version

Summary 💡

The ability to sort Masonry elements from left to right instead of top to bottom where it just fills any spot instead of force sorting from left to right

Examples 🌈

I am assuming this is how it works right now maybe I am wrong

image

Motivation 🔦

I need to sort hotel cards from most expensive to less expensive and its not really displaying the order correctly

@Whitelistedd Whitelistedd added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Apr 12, 2023
@zannager zannager added the component: masonry This is the name of the generic UI component, not the React module! label Apr 12, 2023
@Whitelistedd
Copy link
Author

any updates?

1 similar comment
@Whitelistedd
Copy link
Author

any updates?

@Whitelistedd
Copy link
Author

please?

@ZeeshanTamboli
Copy link
Member

@hbjORbj Can you take a look?

@aredden
Copy link

aredden commented Jun 27, 2023

Yeah- seems like it orders items like-

1 4 7
2 5 8
3 6 9

instead of-

1 2 3
4 5 6
7 8 9

Unless I'm doing something incorrectly, but- the way it works right now makes it very difficult to use masonry with any sort of infinite scrolling- as it would result in things being completely rearranged. I hope there's a simple fix for this and that I'm completely wrong- but as it is, it's not very convenient for most use cases.

@DiegoAndai DiegoAndai added new feature New feature or request and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jul 10, 2023
@DiegoAndai DiegoAndai assigned DiegoAndai and unassigned hbjORbj Jul 10, 2023
@DiegoAndai DiegoAndai added the waiting for 👍 Waiting for upvotes label Jul 10, 2023
@DiegoAndai
Copy link
Member

Hi @Whitelistedd, thanks for the report, and sorry for the late reply

One of the initial requirements for the Masonry component was that items should be placed in the shortest column available, so "by design" it disregards the order they are provided.

It would be nice if we could deactivate this for the use case you report, so if you (or anyone) would like to work on a PR, that would be great 😊🚀

@Rishi556
Copy link
Contributor

Rishi556 commented Nov 17, 2023

I've started implementing it over here: /~https://github.com/Rishi556/material-ui/tree/sequential-columns if anyone wants to follow along i've got a draft PR up #39904. I've got an eslint error to resolve and some tests to add, but maybe I'll be able to PR it in on Monday.

@danilo-leal danilo-leal changed the title [Masonry] Ability to sort Masonry elements from left to right [Masonry] Ability to sort elements from left to right Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: masonry This is the name of the generic UI component, not the React module! new feature New feature or request waiting for 👍 Waiting for upvotes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants