-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
Asteriks class for TextField #14490
Comments
@e11en Here you go: import React from "react";
import PropTypes from "prop-types";
import { withStyles } from "@material-ui/core/styles";
import TextField from "@material-ui/core/TextField";
const styles = theme => ({
asterisk: {
color: "red"
}
});
function TextFields(props) {
const { classes } = props;
return (
<form noValidate autoComplete="off">
<TextField
required
InputLabelProps={{
FormLabelClasses: {
asterisk: classes.asterisk
}
}}
id="standard-required"
label="Required"
defaultValue="Hello World"
margin="normal"
/>
</form>
);
}
TextFields.propTypes = {
classes: PropTypes.object.isRequired
};
export default withStyles(styles)(TextFields); |
But yeah, we could add an <TextField
required
InputLabelProps={{
classes: {
asterisk: classes.asterisk
}
}}
id="standard-required"
label="Required"
defaultValue="Hello World"
margin="normal"
/> instead. Do you want to work on it? :) |
Ah yeah of course! I didn't think of that way of adding the class name. Thanks! I'll have a look at adding that style rule |
|
@e11en @oliviertassinari If anyone is not working on this, would love to make PR. Thanks |
@umairfarooq44 We would be honored to review your pull request :) |
@oliviertassinari thanks for assigning issue. The solution should be in |
FormControlClassKey
does not include the ability to add a class to the asterisk set by therequired
prop of a TextField.I would like to be able to do:
Current situation has no ability to do this and in my styling I need to do this:
The text was updated successfully, but these errors were encountered: