Skip to content

Commit

Permalink
Fix primefaces#3111: Calendar TouchUI modality issues
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Jul 27, 2022
1 parent 3f458d5 commit 95bcd60
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions components/lib/calendar/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1442,6 +1442,8 @@ export const Calendar = React.memo(React.forwardRef((props, ref) => {
overlayEventListener.current = null;
};

props.touchUI && disableModality();

if (props.onVisibleChange) {
props.onVisibleChange({
visible: false,
Expand Down Expand Up @@ -1516,6 +1518,7 @@ export const Calendar = React.memo(React.forwardRef((props, ref) => {

touchUIMaskClickListener.current = () => {
disableModality();
hide();
};
touchUIMask.current.addEventListener('click', touchUIMaskClickListener.current);

Expand All @@ -1534,10 +1537,12 @@ export const Calendar = React.memo(React.forwardRef((props, ref) => {
}

const destroyMask = () => {
touchUIMask.current.removeEventListener('click', touchUIMaskClickListener.current);
touchUIMaskClickListener.current = null;
document.body.removeChild(touchUIMask.current);
touchUIMask.current = null;
if (touchUIMask.current) {
touchUIMask.current.removeEventListener('click', touchUIMaskClickListener.current);
touchUIMaskClickListener.current = null;
document.body.removeChild(touchUIMask.current);
touchUIMask.current = null;
}

let bodyChildren = document.body.children;
let hasBlockerMasks;
Expand Down

0 comments on commit 95bcd60

Please sign in to comment.