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

[ToggleButton] ToggleButtonGroup onChange props [TS] #12326

Closed
2 tasks done
odontogenic opened this issue Jul 29, 2018 · 3 comments
Closed
2 tasks done

[ToggleButton] ToggleButtonGroup onChange props [TS] #12326

odontogenic opened this issue Jul 29, 2018 · 3 comments
Labels
component: toggle button This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process. typescript

Comments

@odontogenic
Copy link

  • This is a Labs issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

ToggleButtonGroup should accept onChange props

Current Behavior

Error unexpected prop

Fix

Including onChange definition in ToggleButtonGroup.d.ts seems to fix this:

export interface ToggleButtonGroupProps
  extends StandardProps<React.HTMLAttributes<HTMLDivElement>, ToggleButtonGroupClassKey> {
  onChange: (event: React.SyntheticEvent, value: any) =>  void
  selected?: boolean;
  exclusive?: boolean;
  value?: any;
}
@oliviertassinari oliviertassinari added good first issue Great for first contributions. Enable to learn the contribution process. typescript package: lab Specific to @mui/lab labels Jul 29, 2018
@oliviertassinari
Copy link
Member

@gingivitis Thanks for raising this issue. We miss the onChange definition. Do you want to submit a pull request with this change? :)

@eps1lon
Copy link
Member

eps1lon commented Jul 29, 2018

Looking at https://github.com/mui-org/material-ui/blob/bb7794ea493041bcb9b2b5b4d343c25eb8849ea5/packages/material-ui-lab/src/ToggleButton/ToggleButtonGroup.js#L42 it looks like no event is passed.

This would also be a good opportunity to make the value generic and see if this provides any value.

@oliviertassinari
Copy link
Member

This would also be a good opportunity to make the value generic and see if this provides any value.

@eps1lon Yes, I agree.

@oliviertassinari oliviertassinari added component: toggle button This is the name of the generic UI component, not the React module! and removed package: lab Specific to @mui/lab labels Jan 9, 2021
@oliviertassinari oliviertassinari changed the title ToggleButtonGroup onChange props [TS] [ToggleButton] ToggleButtonGroup onChange props [TS] Jan 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: toggle button This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process. typescript
Projects
None yet
Development

No branches or pull requests

3 participants