import React, { useState } from 'react';
import { DatePicker } from 'antd';
import dayjs from 'dayjs';
const App: React.FC = () => {
const [date, setDate] = useState([dayjs('2024-08-20'), dayjs('2024-09-30')]);
return (
<DatePicker.RangePicker
disabled={[true, false]}
allowClear={false}
placeholder={['开始日期', '结束日期']}
disabledDate={(current) => {
return current < dayjs().startOf('day');
}}
value={date}
onChange={setDate}
/>
);
};
export default App;
选择结束时间即可复现
选择结束时间后,正常触发 onchange 事件
选择结束时间后,不触发 onchange 事件
Environment | Info |
---|---|
antd | 5.20.3 |
React | 18.3.3 |
System | mac |
Browser | chrome |
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too