Skip to content

Commit

Permalink
Refactor #5110
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Oct 19, 2023
1 parent f150dff commit fe0ba59
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions components/lib/calendar/Calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1497,6 +1497,15 @@ export const Calendar = React.memo(
};

const onOverlayEntered = () => {
if (!props.touchUI && overlayRef && overlayRef.current && inputRef && inputRef.current && !appendDisabled()) {
if (props.view === 'date') {
overlayRef.current.style.width = DomHandler.getOuterWidth(overlayRef.current) + 'px';
overlayRef.current.style.minWidth = DomHandler.getOuterWidth(inputRef.current) + 'px';
} else {
overlayRef.current.style.width = DomHandler.getOuterWidth(inputRef.current) + 'px';
}
}

bindOverlayListener();
props.onShow && props.onShow();
DomHandler.focusFirstElement(overlayRef.current);
Expand Down Expand Up @@ -1526,13 +1535,6 @@ export const Calendar = React.memo(
if (appendDisabled()) {
DomHandler.relativePosition(overlayRef.current, inputRef.current);
} else {
if (props.view === 'date') {
overlayRef.current.style.width = DomHandler.getOuterWidth(overlayRef.current) + 'px';
overlayRef.current.style.minWidth = DomHandler.getOuterWidth(inputRef.current) + 'px';
} else {
overlayRef.current.style.width = DomHandler.getOuterWidth(inputRef.current) + 'px';
}

DomHandler.absolutePosition(overlayRef.current, inputRef.current);
}
}
Expand Down

0 comments on commit fe0ba59

Please sign in to comment.