在移动端,点击DatePicker 控件时,会出现软键盘,可以通过以下方式隐藏软键盘。

function DatePickerDemo(props) {
    let dateRef = React.createRef();
    return (
    <div className="birth-date" ref={dateRef}>
                          <DatePicker
                            dropdownClassName="dark-mode"
                            getCalendarContainer={() => dateRef.current}
                            placeholder="请选择日期"
                            disabledDate={disabledDate}
                            format="YYYY-MM-DD"
                            onChange={e => handleDateChange(e)}
                            allowClear={false}
                          />
                        </div>
    
)

}

css:

.birth-date {
  .ant-calendar-input-wrap {
    display: none;
  }
}

 

相关文章:

  • 2021-09-27
  • 2021-09-05
  • 2021-10-23
  • 2022-02-09
  • 2022-12-23
  • 2022-01-05
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-20
  • 2022-12-23
  • 2021-06-28
  • 2022-12-23
  • 2022-12-23
  • 2021-05-31
相关资源
相似解决方案