@@ -73,26 +73,41 @@ static YGSize RNDateTimePickerShadowViewMeasure(YGNodeConstRef node, float width
7373 // See: https://github.com/react-native-datetimepicker/datetimepicker/issues/1014
7474 size.width = MAX (size.width , 280 );
7575
76+ // Check if we're using inline/calendar style
77+ BOOL isInlineStyle = NO ;
78+ if (@available (iOS 14.0 , *)) {
79+ isInlineStyle = shadowPickerView.picker .preferredDatePickerStyle == UIDatePickerStyleInline;
80+ }
81+
7682 // Respect the provided width constraint to allow the picker to expand to full width
7783 // when a specific width is provided or when measuring at-most mode
7884 if (widthMode == YGMeasureModeExactly) {
7985 size.width = width;
8086 } else if (widthMode == YGMeasureModeAtMost) {
8187 // For inline/calendar style, try to use the full available width
8288 // For other styles, use the minimum width needed
83- if (@available (iOS 14.0 , *)) {
84- if (shadowPickerView.picker .preferredDatePickerStyle == UIDatePickerStyleInline) {
85- size.width = width; // Use full available width for calendar
86- } else {
87- size.width = MIN (size.width + 10 , width);
88- }
89+ if (isInlineStyle) {
90+ size.width = width; // Use full available width for calendar
8991 } else {
9092 size.width = MIN (size.width + 10 , width);
9193 }
9294 } else {
9395 // For undefined mode, add small padding
9496 size.width += 10 ;
9597 }
98+
99+ // UICalendarView (inline style) requires sufficient height to render content
100+ // Without this, we get: "UICalendarView's height is smaller than it can render its content in"
101+ if (isInlineStyle) {
102+ size.height = MAX (size.height , 330 );
103+
104+ // Respect height constraints if provided
105+ if (heightMode == YGMeasureModeExactly) {
106+ size.height = height;
107+ } else if (heightMode == YGMeasureModeAtMost) {
108+ size.height = MIN (size.height , height);
109+ }
110+ }
96111 });
97112
98113 return (YGSize){
0 commit comments