Ant design DatePicker ----移动端,点击DatePicker 时,会出现软键盘,隐藏方案


在移动端,点击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; }
}

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM