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

[Unstable_Gridv2] sorted responsize keys based on breakpoint value #34987

Merged
merged 4 commits into from Nov 14, 2022

Conversation

sai6855
Copy link
Contributor

@sai6855 sai6855 commented Nov 2, 2022

@mui-bot
Copy link

mui-bot commented Nov 2, 2022

Messages
📖 Netlify deploy preview: https://deploy-preview-34987--material-ui.netlify.app/

Details of bundle changes

Generated by 🚫 dangerJS against 9a3ce81

@zannager zannager added the component: Grid The React component. label Nov 3, 2022
Comment on lines 37 to 50
const keys = (
Object.keys(responsize).length > breakpoints.keys.length
? breakpoints.keys
: Object.keys(responsize);
: Object.keys(responsize)
).sort((key1, key2) => {
// @ts-ignore already checked that responsize is an object
const breakpointValue1: T = breakpoints.values[key1];
// @ts-ignore already checked that responsize is an object
const breakpointValue2: T = breakpoints.values[key2];
if (typeof breakpointValue1 === 'number' && typeof breakpointValue2 === 'number') {
return breakpointValue1 - breakpointValue2;
}
return 0;
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you create a util function in this file with a test to make sure that it works as expected?

Something like this:

const keys = sortBreakpoints(breakpoints, responsive);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah sure I'll do it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the fix from https://github.com/mui/material-ui/pull/34985/files, it looks simple. Can you do that with a test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok sure, i'll do that and add test

Copy link
Contributor Author

@sai6855 sai6855 Nov 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the fix from https://github.com/mui/material-ui/pull/34985/files, it looks simple. Can you do that with a test?

i've added the test and rewrote logic based on https://github.com/mui/material-ui/pull/34985/files to sort keys

@siriwatknp siriwatknp added bug 🐛 Something doesn't work PR: needs test The pull request can't be merged labels Nov 3, 2022
@siriwatknp
Copy link
Member

@Falkyouall tag you as a reviewer.

@sai6855 sai6855 changed the title Unstable_Gridv2 sorted responsize keys based on breakpoint value [Unstable_Gridv2] sorted responsize keys based on breakpoint value Nov 3, 2022
Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Thanks for your first contribution!

I pushed an update to fix my own typo 😅.

@sai6855
Copy link
Contributor Author

sai6855 commented Nov 3, 2022

hey thanks for approval, looking forward for more contribution

@sai6855
Copy link
Contributor Author

sai6855 commented Nov 10, 2022

hey @siriwatknp any idea when this PR can be merged or why this PR hasn't been merged yet?

@michaldudak michaldudak merged commit 54aca16 into mui:master Nov 14, 2022
the-mgi pushed a commit to the-mgi/material-ui that referenced this pull request Nov 17, 2022
daniel-rabe pushed a commit to daniel-rabe/material-ui that referenced this pull request Nov 29, 2022
…ui#34987)

Co-authored-by: siriwatknp <siriwatkunaporn@gmail.com>
feliperli pushed a commit to jesrodri/material-ui that referenced this pull request Dec 6, 2022
…ui#34987)

Co-authored-by: siriwatknp <siriwatkunaporn@gmail.com>
@sai6855 sai6855 deleted the grid-v2-breakpoint branch March 18, 2023 11:05
@sai6855 sai6855 removed the PR: needs test The pull request can't be merged label Oct 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: Grid The React component.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Grid V2 breakpoint only applied with props order
5 participants