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

[material-next][ButtonGroup] Copy ButtonGroup to material next #39716

Closed

Conversation

lhilgert9
Copy link
Contributor

ButtonGroup issue: #39686
Material You umbrella issue: #29345

Changes

  • Copy ButtonGroup from material v5
  • Fix imports

@mui-bot
Copy link

mui-bot commented Nov 2, 2023

Netlify deploy preview

https://deploy-preview-39716--material-ui.netlify.app/

Bundle size report

Details of bundle changes (Toolpad)
Details of bundle changes

Generated by 🚫 dangerJS against 0dfb3b5

@lhilgert9
Copy link
Contributor Author

I think the errors in the tests are caused by the different ButtonGroupContexts in the Button and the ButtonGroup. I would suggest to delete the .test file for this PR and add it again in a later PR when the new ButtonGroupContext is implemented in the Button and ButtonGroup of material-next.

Copy link
Member

@DiegoAndai DiegoAndai left a comment

Choose a reason for hiding this comment

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

Hey @lhilgert9, thanks for working on this 🎉

About the failing tests, I think these imports should be changed, would that fix it?

import * as React from 'react';
import { expect } from 'chai';
import { createRenderer, describeConformance, screen } from '@mui-internal/test-utils';
import ButtonGroup, { buttonGroupClasses as classes } from '@mui/material/ButtonGroup';
Copy link
Member

Choose a reason for hiding this comment

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

This should be imported from @mui/material-next/ButtonGroup

import { createRenderer, describeConformance, screen } from '@mui-internal/test-utils';
import ButtonGroup, { buttonGroupClasses as classes } from '@mui/material/ButtonGroup';
import { ThemeProvider, createTheme } from '@mui/material/styles';
import Button, { buttonClasses } from '@mui/material/Button';
Copy link
Member

Choose a reason for hiding this comment

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

This should be imported from @mui/material-next/Button

@DiegoAndai
Copy link
Member

About the failing tests, I think these exports should be changed, would that fix it?

Answering to myself: it probably breaks other tests because these changes #38520 need to be ported to material-next's Button. We could port the Button's changes on that PR to material-next's Button in this PR.

@lhilgert9
Copy link
Contributor Author

Hey @lhilgert9, thanks for working on this 🎉

About the failing tests, I think these exports should be changed, would that fix it?

No, the problem is, that the Button in material-next is not implementing the ButtonGroupContext, so the test would fail, because the props are not provided to the buttons.
In the main PR #39699 I implemented this and fixed the imports in the .test file, but there I have an error somewhere, which I have not yet found.

@DiegoAndai
Copy link
Member

In the main PR #39699 I implemented this and fixed the imports in the .test file, but there I have an error somewhere, which I have not yet found.

Let's implement ButtonGroupContext in material-next's Button and update the imports in this PR. Then, we can work together on trying to figure out the error you're facing.

@lhilgert9
Copy link
Contributor Author

In the main PR #39699 I implemented this and fixed the imports in the .test file, but there I have an error somewhere, which I have not yet found.

Let's implement ButtonGroupContext in material-next's Button and update the imports in this PR. Then, we can work together on trying to figure out the error you're facing.

So you want to continue in this PR because I've already completely done this work to the other PR. As I said, it only depends on the error that occurs during the test. Maybe we could also just try to find the error in PR #39699

@danilo-leal danilo-leal added component: button This is the name of the generic UI component, not the React module! package: material-ui Specific to @mui/material v6.x component: ButtonGroup The React component. and removed component: button This is the name of the generic UI component, not the React module! labels Nov 2, 2023
@DiegoAndai DiegoAndai changed the title [ButtonGroup][material-next] Copy ButtonGroup to material next [material-next][ButtonGroup] Copy ButtonGroup to material next Nov 2, 2023
@mj12albert
Copy link
Member

So you want to continue in this PR

Yes ~ we'll be able to review and iterate much faster than one big PR!

@lhilgert9 lhilgert9 closed this Nov 3, 2023
@lhilgert9 lhilgert9 deleted the copy-button-group-to-material-next branch November 3, 2023 20:56
@lhilgert9 lhilgert9 restored the copy-button-group-to-material-next branch November 3, 2023 21:15
@lhilgert9 lhilgert9 deleted the copy-button-group-to-material-next branch November 3, 2023 21:22
@mj12albert
Copy link
Member

Replaced by #39739

@DiegoAndai DiegoAndai removed the v6.x label Dec 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: ButtonGroup The React component. package: material-ui Specific to @mui/material v7.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants