Skip to content

Commit

Permalink
Fix #6887: Update onDateSelect function to include isUpdateViewDate p…
Browse files Browse the repository at this point in the history
…arameter (#6890)
  • Loading branch information
Rekl0w authored Jul 15, 2024
1 parent a683918 commit ff49bcb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions components/lib/calendar/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1086,7 +1086,7 @@ export const Calendar = React.memo(
const month = value.getMonth();
const year = value.getFullYear();

onDateSelect(event, { day, month, year, selectable: isSelectable(day, month, year) });
onDateSelect(event, { day, month, year, selectable: isSelectable(day, month, year) }, null, true);
}
};

Expand Down Expand Up @@ -1616,7 +1616,7 @@ export const Calendar = React.memo(
}
};

const onDateSelect = (event, dateMeta, timeMeta) => {
const onDateSelect = (event, dateMeta, timeMeta, isUpdateViewDate) => {
if (!event) {
return;
}
Expand Down Expand Up @@ -1645,7 +1645,7 @@ export const Calendar = React.memo(
selectDate(event, dateMeta, timeMeta);
}

if (!props.inline && isSingleSelection() && (!props.showTime || props.hideOnDateTimeSelect)) {
if (!props.inline && isSingleSelection() && (!props.showTime || props.hideOnDateTimeSelect) && !isUpdateViewDate) {
setTimeout(() => {
hide('dateselect');
}, 100);
Expand Down

0 comments on commit ff49bcb

Please sign in to comment.