gpt4 book ai didi

javascript - 如何不允许用户在带有选择选项的输入字段中输入值

转载 作者:行者123 更新时间:2023-11-30 11:27:22 26 4
gpt4 key购买 nike

我使用 react-day-picker(DayPickerInput 组件),我希望当用户点击相关字段时,当日期选择器窗口打开时,用户将无法使用键盘输入值,并且他可以通过弹出窗口更改值。

我不知道这是一个DayPickerInput的属性(我搜索了没找到),还是字段本身的通用属性...

最佳答案

好的,我只需要像这样添加 readOnly:

<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>

(

关于javascript - 如何不允许用户在带有选择选项的输入字段中输入值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47529079/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com