Unable to set "data-testid" on the inner input of a Checkbox component. #20160
Labels
component: checkbox
This is the name of the generic UI component, not the React module!
component: switch
This is the name of the generic UI component, not the React module!
Current Behavior 😯
It isn't possible to add a "data-testid" on the inner input element for a Checkbox component via inputProps when using typescript 3.8.3. It gives the typescript error "Type '{ 'data-testid': string; }' is not assignable to type 'InputHTMLAttributes'."
Expected Behavior 🤔
The data-testid attribute is set on the inner input element in the same way as for TextField components.
Steps to Reproduce 🕹
Create a Checkbox component which sets inputProps including a data-testid with.:
<Checkbox inputProps={{ "data-testid": "test-checkbox" }} />
See Codesandbox example
Your Environment 🌎
The text was updated successfully, but these errors were encountered: