Repository navigation
Conversation
| mode, | ||
| minuteInterval, | ||
| timeZoneOffsetInMinutes, | ||
| iOsPickerStyle = {}, |
There was a problem hiding this comment.
I'd vote for this prop to be named just style. There are several other props such as timeZoneOffsetInMinutes that only work on one platform, and we never use any ios/android suffix/prefix to distinguish those.
There was a problem hiding this comment.
Do you suggest to use same styles on outer container and also DatePicker?
There was a problem hiding this comment.
There was a problem hiding this comment.
huh I didn't know that! (it's not documented). That brings me to a question - why is RNDateTimePicker wrapped in a View? Would it make sense to remove that wrapping view?
There was a problem hiding this comment.
I can remove it, I've tested it and it works without the external View.
I just wonder whether there will be breaking change in case someone had a hack to get around inability to change height of the datepicker.
There was a problem hiding this comment.
Alright added it to example to App.js and has documentation in Readme.md. I've kept it as iOS only due to the fact that you can't really style Android pickers this way.
There was a problem hiding this comment.
I can remove it, I've tested it and it works without the external View.
in that case I'd remove it, and if folks really need to wrap it (I don't see any necessity for that), they can do it themselves
I checked https://github.com/facebook/react-native/blame/master/Libraries/Components/DatePicker/DatePickerIOS.ios.js and from the blame, it doesn't seem like there was specific reason for adding the wrapping view
Co-Authored-By: Vojtech Novak <vonovak@gmail.com>
|
@lochness42 I'm also wondering - just because people may try to use various styling options - what are the limitations as to what styling props people can use here? I see the motivation was to change picker size. Is it possible to change background color or border for example? Thanks! |
|
@vonovak background color and border does work |
|
I'll release in the evening. Which reminds we need a changelog entry - would you be willing to write that @lochness42 ? Question now is, should the be a major or minor bump? |
|
I would say minor as it fixes bug where height couldn't be readjusted, styling should be preserved from before. So no real new behaviour apart from bug fix. |

Summary
At the moment on iOS picker has fixed height of 216px, this PR exposes a new style property which is passed down to picker itself (style property is only propagated to internal View container and picker can overflow it)
If this style is not defined, we will fall back to height of 216px so it won't break existing apps.
Test Plan
What's required for testing (prerequisites)?
What are the steps to reproduce (after prerequisites)?
Compatibility
Checklist
README.mdCHANGELOG.mdexample/App.js)