Skip to content

Commit f4767e8

Browse files
fortmarekvonovak
andauthored
fix(ios): picker width too small (#675)
* Fix date format change * fix fabric compilation Co-authored-by: Vojtech Novak <[email protected]>
1 parent 462c499 commit f4767e8

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ios/RNDateTimePickerShadowView.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,8 @@ static YGSize RNDateTimePickerShadowViewMeasure(YGNodeRef node, float width, YGM
4343
if (@available(iOS 14.0, *)) {
4444
[shadowPickerView.picker setPreferredDatePickerStyle:shadowPickerView.displayIOS];
4545
}
46-
size = [shadowPickerView.picker sizeThatFits:UILayoutFittingCompressedSize];
46+
size = [shadowPickerView.picker sizeThatFits:UILayoutFittingCompressedSize];
47+
size.width += 10;
4748
});
4849

4950
return (YGSize){

ios/fabric/RNDateTimePickerComponentView.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,8 @@ - (void) updateMeasurements {
8787
if (_state == nullptr) {
8888
return;
8989
}
90-
9190
CGSize size = [_dummyPicker sizeThatFits:UILayoutFittingCompressedSize];
91+
size.width += 10;
9292
auto newState = RNDateTimePickerState{RCTSizeFromCGSize(size)};
9393
_state->updateState(std::move(newState));
9494
}

0 commit comments

Comments
 (0)