Css 材质ui/选取器:将位置开始添加到KeyboardDatePicker的InputDorNMentProps属性时,会出现不需要的边距
我从物料ui/选取器中获取了此组件:Css 材质ui/选取器:将位置开始添加到KeyboardDatePicker的InputDorNMentProps属性时,会出现不需要的边距,css,reactjs,typescript,datepicker,material-ui,Css,Reactjs,Typescript,Datepicker,Material Ui,我从物料ui/选取器中获取了此组件: <KeyboardDatePicker value={selectedDate} onChange={(_, newValue) => handleClick(newValue)} labelFunc={renderLabel} disableToolbar variant='inline' inputVariant='filled' format='YYYYMMDD' allowKeyboardC
<KeyboardDatePicker
value={selectedDate}
onChange={(_, newValue) => handleClick(newValue)}
labelFunc={renderLabel}
disableToolbar
variant='inline'
inputVariant='filled'
format='YYYYMMDD'
allowKeyboardControl
autoOk
inputProps={{
'data-testid': `input-${name}`
}}
InputAdornmentProps={{ position: 'start' }}
/>
这会导致图标偏离中心。
这就是没有InputDorNMentProps时的情况:
[1] :
有了它:
[2] :
可能是什么原因造成的?请按以下方式尝试,并参阅以了解更多详细信息
InputAdornmentProps={{ position: 'start', variant: 'standard' }}
对我来说,解决这个问题的方法是指定键盘按钮的弹出边缘:“开始,看这里
InputAdornmentProps={{ position: 'start', variant: 'standard' }}