Material-UI Multiline TextField中的输入文本彼此重叠(而不是标签)。
请参阅CodeSandBox中的示例和代码:https://codesandbox.io/s/keen-wu-yquk6
我怀疑这可能与我将Font-Sized(字体大小)增加到30,但是行高(或其他内容)仍配置为默认大小字体有关。
import React from "react";
import styled from "styled-components";
import { makeStyles } from "@material-ui/core/styles";
import TextField from "@material-ui/core/TextField";
const useStyles = makeStyles(theme => ({
container: {
display: "flex",flexWrap: "wrap"
},textField: {
marginLeft: theme.spacing(1),marginRight: theme.spacing(1),width: 350
}
}));
const styledtextField = styled(TextField)`
.MuiInput-underline::before {
border-bottom-color: white;
}
.MuiInput-underline:hover:not(.Mui-disabled)::before {
border-bottom-color: white;
}
.MuiInput-underline::after {
border-bottom-color: #fdcd39;
}
`;
const styledtextArea1 = ({ Label,fieldType,handleChange }) => {
const classes = useStyles();
return (
<styledtextField
id="standard-basic"
classname={classes.textField}
label="Test Label"
multiline
fullWidth
rows="5"
variant="outlined"
margin="normal"
// onChange={handleChange(fieldType)}
InputLabelProps={{
style: {
color: "black",fontSize: 30,borderBottom: "white",fontFamily: "Akrobat"
}
}}
inputProps={{
style: {
fontSize: 30,color: "#fdcd39",fontFamily: "Akrobat",fontWeight: 800
}
}}
/>
);
};
export { styledtextArea1 };
非常感谢您的协助。