Skip to content

Conversation

@christophpurrer
Copy link
Contributor

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

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 default to 0) we the place holder text won't appear
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
Copy link
Contributor

@Naturalclar Naturalclar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! thanks for adding example as well 👍

@Naturalclar Naturalclar changed the title Add placeholder support for Windows feat: Add placeholder support for Windows Mar 15, 2022
@Naturalclar Naturalclar merged commit 16cdaee into react-native-picker:master Mar 15, 2022
github-actions bot pushed a commit that referenced this pull request Mar 15, 2022
# [2.4.0](v2.3.1...v2.4.0) (2022-03-15)

### Bug Fixes

* Workaround XAML bug with ComboBox and dark theme ([#380](#380)) ([20cac25](20cac25))

### Features

* Add placeholder support for Windows ([#386](#386)) ([16cdaee](16cdaee))
@Naturalclar
Copy link
Contributor

🎉 This PR is included in version 2.4.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

KewtonV pushed a commit to KewtonV/picker that referenced this pull request Oct 29, 2025
# [2.4.0](react-native-picker/picker@v2.3.1...v2.4.0) (2022-03-15)

### Bug Fixes

* Workaround XAML bug with ComboBox and dark theme ([react-native-picker#380](react-native-picker#380)) ([20cac25](react-native-picker@20cac25))

### Features

* Add placeholder support for Windows ([react-native-picker#386](react-native-picker#386)) ([16cdaee](react-native-picker@16cdaee))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants