diff --git a/src/components/calendar/Calendar.js b/src/components/calendar/Calendar.js index 2a914e9573..68890aef02 100644 --- a/src/components/calendar/Calendar.js +++ b/src/components/calendar/Calendar.js @@ -1593,13 +1593,9 @@ export class Calendar extends Component { this.enableModality(); } else { - if (this.props.appendTo) { - DomHandler.absolutePosition(this.overlayRef.current, this.inputElement); - this.overlayRef.current.style.minWidth = DomHandler.getWidth(this.container) + 'px'; - } - else { - DomHandler.relativePosition(this.overlayRef.current, this.inputElement); - } + const container = this.inputElement.parentElement; + this.overlayRef.current.style.minWidth = DomHandler.getOuterWidth(container) + 'px'; + DomHandler.absolutePosition(this.overlayRef.current, container); } } @@ -2715,18 +2711,22 @@ export class Calendar extends Component { } renderMonthView() { - const backwardNavigator = this.renderBackwardNavigator(); - const forwardNavigator = this.renderForwardNavigator(); + const backwardNavigator = this.renderBackwardNavigator(true); + const forwardNavigator = this.renderForwardNavigator(true); const yearElement = this.renderTitleYearElement(this.getViewDate().getFullYear()); const months = this.renderMonthViewMonths(); return ( <> -