Skip to content

Commit d2b7abf

Browse files
Fix for month and year select not showing properly in bootstrap 5 modal
1 parent 0318a27 commit d2b7abf

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

ui/widgets/datepicker.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2208,7 +2208,12 @@ $.fn.datepicker = function( options ) {
22082208

22092209
/* Append datepicker main container to body if not exist. */
22102210
if ( $( "#" + $.datepicker._mainDivId ).length === 0 ) {
2211-
$( "body" ).append( $.datepicker.dpDiv );
2211+
if ( options[ "container" ] && $( options[ "container" ] ).length ) {
2212+
$( options[ "container" ] ).append( $.datepicker.dpDiv );
2213+
}
2214+
else {
2215+
$( "body" ).append( $.datepicker.dpDiv );
2216+
}
22122217
}
22132218

22142219
var otherArgs = Array.prototype.slice.call( arguments, 1 );

0 commit comments

Comments
 (0)