Skip to content

Commit

Permalink
Fix primefaces#6887: Update onDateSelect function to include isUpdate…
Browse files Browse the repository at this point in the history
…ViewDate parameter
  • Loading branch information
Rekl0w committed Jul 15, 2024
1 parent 9163fd0 commit cd47f3a
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 cd47f3a

Please sign in to comment.