Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add placeholder support for Windows #386

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 📦🚀

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.

None yet

2 participants