beefe / react-native-picker

A Native Picker with high performance.
1.75k stars 785 forks source link

[iOS] Opening picker immediately in ComponentDidMount some Views are missing #157

Open ssomnoremac opened 7 years ago

ssomnoremac commented 7 years ago

Seems like if you are going to open the picker as the first action as a scene is rendered you should do so in ComponentDidMount. If I do that without a timeout I often lose Views. They just disappear in iOS. Not sure what to say about this. Is there are better solution that using a timeout to allow complex screens to render first?

PFBoy commented 7 years ago

Same problem with you. When I input something in textinput, render method will called and the tips "enter xxx characters at most" in view will be changed. Then, textinput component will lose focus, keyboard will dismiss. Any solution now?

ssomnoremac commented 7 years ago

I would just be careful about opening the picker when a scene renders; however, I noticed the Views disappearing even after my fix which is to say

 componentDidMount(){
        setTimeout(this._openPicker, 800)
    }

is a hack and there seems to be some issue here. Unfortunately, this being a native solution means its not so easy to track down.

PFBoy commented 7 years ago

OK,I will try this later. If I found any effective solution, I will be back. Thanks so much.