Situation at Present 🤔
The component I am currently working with looks like this:
export const BirthdayTextFields = styled(TextField)`
width: 80px;
margin-right: 10px;
border-radius: 50px;
`;
Here is how I am using it:
<BirthdayTextFields
id="filled-dense-hidden-label"
margin="dense"
hiddenLabel
variant="filled"
placeholder="18"
inputProps={{ 'aria-label': 'dense hidden label' }}
onChange={this.handleChange('day')}
/>
However, due to the "filled" variant, I am unable to set the border-radius. To work around this issue, I tried overriding the TextField Component rule using the following method:
export const TextFieldWrapper = styled(TextField)`
fieldset {
border-radius: 50px;
}
`;
By using the overridden style in a similar way, but with the variant set to "outlined", I was able to make it work successfully.
<TextFieldWrapper
id="outlined-dense"
label="Last name"
margin="dense"
variant="outlined"
onChange={this.handleChange('lastName')}
/>
How can we address this issue effectively? I also attempted to add the fieldset value to BirthdayTextFields, but because of the "filled" variant, it did not have much effect.
export const BirthdayTextFields = styled(TextField)`
width: 80px;
margin-right: 10px;
fieldset {
border-radius: 50px;
}
`;
Technical Specifications
Operating System: Windows 10
Technology and Versions:
- Material-UI: ^3.9.3
- React: ^16.8.6
Web Browser: Chrome