ptmt / react-native-macos

[deprecated in favor of https://microsoft.github.io/react-native-windows/] React Native for macOS is an experimental fork for writing desktop apps using Cocoa
MIT License
11.25k stars 429 forks source link

Picker component unimplemented #202

Open eugbash opened 6 years ago

eugbash commented 6 years ago

It would be great to have the Picker component on macos that renders the native picker component (https://facebook.github.io/react-native/docs/picker.html). Do you have any plans to implement this?

ptmt commented 6 years ago

Do you mean https://developer.apple.com/documentation/appkit/nscombobox? As far as I know, I tried to implement it before, need to investigate if it's available.

eugbash commented 6 years ago

Exactly. Yes, I found it at /Libraries/Picker/PickerIOS.macos.js I was confused as the render method in /Libraries/Components/Picker/Picker.js returned <UnimplementedView />.

Updating its condition to if (Platform.OS === 'ios' || Platform.OS === 'macos') { // $FlowFixMe found when converting React.createClass to ES6 return <PickerIOS {...this.props}>{this.props.children}</PickerIOS>; } fixed the issue.

However, NSComboBox seems to render not quite right (please, see the image below). nscombobox

ptmt commented 6 years ago

Thanks for your feedback! If you had time to send PR with this (even unfinished) that would be extremely helpful, I'll try to see what's happening with the rendering.