react-native-modalbox icon indicating copy to clipboard operation
react-native-modalbox copied to clipboard

Picker does not show inside Modal

Open matc4 opened this issue 8 years ago • 5 comments

Hello, first, Great Work with this component!,

A simple Picker is not showing inside Modal. <Picker > <Picker.Item label="0" value="0" /> <Picker.Item label="1" value="1" /> </Picker>

matc4 avatar Mar 04 '16 18:03 matc4

Thanks @matiascba ! Are you using the RN Picker component ?

maxs15 avatar Mar 04 '16 18:03 maxs15

Yes, is the RN Picker

matc4 avatar Mar 04 '16 18:03 matc4

Ok, I will check that

maxs15 avatar Mar 04 '16 18:03 maxs15

It kinda works for me, but sometimes (maybe 15% of the time), the ModalBox aligns itself a few pixels below the bottom of the screen. I've also tried centering it in the page, but the same thing happens... ModalBox renders off center vertically. Not sure if this is related to the Picker being in the ModalBox, or if this is a common issue no matter what component you put in it.

Here is the code I'm using.

<ModalBox position={'bottom'} style={[styles.modal]} ref={"gameTypeModal"} swipeToClose={false} onClosed={this.onClose.bind(this)} onOpened={this.onOpen.bind(this)} onClosingState={this.onClosingState.bind(this)}>
  <Picker style={{alignSelf:'stretch',backgroundColor:'white'}} selectedValue={game.type} onValueChange={this._pickerDidChange.bind(this)}>
    {pickerItems}
  </Picker>
</ModalBox>
let pickerItems = Object.keys(gameTypes).sort().map((key, index) => {
  let gameDetails = gameTypes[key];
  return (<Picker.Item key={index} label={gameDetails.name} value={key} />);
});
const styles = StyleSheet.create({
  modal: {
    height:220,
    justifyContent: 'center',
    alignItems: 'center',
    backgroundColor:'transparent',
  },
  text: {
    height : 100,
    color: "black",
    fontSize: 22,
    backgroundColor : 'red',
  }
})

72apps avatar Mar 24 '16 04:03 72apps

Any updates on this issue?

serfgy avatar Nov 19 '18 05:11 serfgy