Javascript 如何不允许用户使用选择选项在输入字段中输入值
我使用react day picker(DayPickerInput组件),我希望当用户单击相关字段时,当day picker窗口打开时,用户将无法使用键盘输入值,并且可以通过弹出窗口更改值 我不知道这是DayPickerInput的属性(我搜索了但没有找到),还是字段本身的常规属性…好, 我只需要像这样添加readOnly:Javascript 如何不允许用户使用选择选项在输入字段中输入值,javascript,reactjs,react-day-picker,Javascript,Reactjs,React Day Picker,我使用react day picker(DayPickerInput组件),我希望当用户单击相关字段时,当day picker窗口打开时,用户将无法使用键盘输入值,并且可以通过弹出窗口更改值 我不知道这是DayPickerInput的属性(我搜索了但没有找到),还是字段本身的常规属性…好, 我只需要像这样添加readOnly: <DayPickerInput readOnly // just it!! dayPickerProps={{localeUtils: Moment
<DayPickerInput
readOnly // just it!!
dayPickerProps={{localeUtils: MomentLocaleUtils, locale:"he"}}
className={theme.dayPicker}
placeholder={this.props.hintText}
value={value}
onDayChange={(date: moment.Moment) => this.handleChange(date.toDate())}>
</DayPickerInput>
this.handleChange(date.toDate())}>
(