react-native-picker / picker

Picker is a cross-platform UI component for selecting an item from a list of options.
MIT License
1.51k stars 286 forks source link

feat: Add placeholder support for Windows #386

Closed christophpurrer closed 2 years ago

christophpurrer commented 2 years ago

This change brings parity with the react-native-windows 0.63 Picker implementation of not setting a default index for the picker: https://github.com/microsoft/react-native-windows/blob/0.63-stable/vnext/Microsoft.ReactNative/Views/PickerViewManager.cpp#L40

If we don't set the index to -1 (or due to defaulting to 0) the place holder text won't appear otherwise https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.combobox.placeholdertext?view=winrt-22000#remarks

This change also adds placeholder text support for Windows only + an example to use it.

Screen Shot 2022-03-01 at 10 45 03 PM Screen Shot 2022-03-01 at 10 45 13 PM
Naturalclar commented 2 years ago

:tada: This PR is included in version 2.4.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: