facebook / react-native

A framework for building native applications using React
https://reactnative.dev
MIT License
119.04k stars 24.32k forks source link

Make Pickers able to have borders without being wrapped in another view #19254

Closed andersonaddo closed 6 years ago

andersonaddo commented 6 years ago

Environment

Environment: OS: Windows 10 Node: 8.9.4 Yarn: 1.5.1 npm: 5.6.0 Watchman: Not Found Xcode: N/A Android Studio: Version 2.3.0.0 AI-162.4069837

Packages: (wanted => installed) react: 16.2.0 => 16.2.0 react-native: 0.54.0-rc.3 => 0.54.0-rc.3

Steps to Reproduce

Create a vanilla Picker component and attempt to add a border to it. Here's an example:

<Picker
        style = {{width: 200, borderColor: "#555555", borderWidth: 2}}
        selectedValue={this.state.transportMode}
        onValueChange={(itemValue, itemIndex) => this.setState((previousState)=>{
          return {transportMode: itemValue}
        })}>
        <Picker.Item label="Driving" value="driving" />
        <Picker.Item label="Bicycling" value="bicycling" />
        <Picker.Item label="Walking" value="walking" />
      </Picker>

Expected Behavior

A border would appear

Actual Behavior

No border appears. I'm surmising that the only way to add a border to a Picker is by wrapping it in another view. This is pretty inconvenient, if you ask me. Pickers should be able to react to border props directly. Am I missing something here? Or perhaps this is something that needs fixing?

I don't believe this should be difficult to fix.

react-native-bot commented 6 years ago

Thanks for posting this! It looks like your issue may be missing some necessary information. Can you run react-native info and edit your issue to include these results under the Environment section?

Thank you for your contributions.

andersonaddo commented 6 years ago

@react-native-bot Fixed. How's that, my automated friend?

react-native-bot commented 6 years ago

Closing as we have not received confirmation that this can be reproduced on 0.55.4 (stable) or 0.56.0-rc (release candidate).