fix: 修复投资日历切换月份时自动打开事件弹窗的问题
- 利用 Ant Design Calendar onSelect 的 info.source 参数区分选择来源 - 只有点击日期单元格 (source='date') 时才打开弹窗 - 切换月份/年份时不再触发弹窗 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -220,7 +220,12 @@ const InvestmentCalendar = () => {
|
||||
};
|
||||
|
||||
// 处理日期选择
|
||||
const handleDateSelect = (value) => {
|
||||
// info.source 区分选择来源:'date' = 点击日期,'month'/'year' = 切换月份/年份
|
||||
const handleDateSelect = (value, info) => {
|
||||
// 只有点击日期单元格时才打开弹窗,切换月份/年份时不打开
|
||||
if (info?.source !== 'date') {
|
||||
return;
|
||||
}
|
||||
setSelectedDate(value);
|
||||
loadDateEvents(value);
|
||||
setModalVisible(true);
|
||||
|
||||
Reference in New Issue
Block a user