Javascript 材质UI InputProps End装饰:图标不';t显示内部输入
在自定义输入中显示图标时出现小问题 我的代码是:Javascript 材质UI InputProps End装饰:图标不';t显示内部输入,javascript,css,reactjs,material-ui,react-props,Javascript,Css,Reactjs,Material Ui,React Props,在自定义输入中显示图标时出现小问题 我的代码是: <TutorialsCommentInput placeholder="Write your opinion..." style={{ padding: "20px" }} fullWidth="true" InputProps={{ endAdornment: ( <InputAdornment
<TutorialsCommentInput
placeholder="Write your opinion..."
style={{ padding: "20px" }}
fullWidth="true"
InputProps={{
endAdornment: (
<InputAdornment position="end">
<Icon />
</InputAdornment>
),
}}
/>
我已经按照每一个步骤来做了,图标在输入之外工作完全正常,不知道出了什么问题。你真的需要发布tutorialcommentinput的定义。。。我不知道没有它会发生什么。您的图标是返回svg的组件吗?问题可能是一个超大图标@JeffB我已经更新了我的post@codeSandBox–antoineso这是一个svg,在输入端之外工作得非常好。我通过使用
makeStyles
而不是WithStyle
export const TutorialsCommentInput = withStyles((theme) => ({
input: {
borderRadius: 0,
backgroundColor: '#262626',
fontSize: '15px',
fontWeight: 500,
padding: '2px 8px 2px',
height: '42px',
color: '#B6B6B6',
fontFamily: [
'Nunito',
'sans-serif'
]
}
}))(InputBase)