React-native-picker-select: Cannot call this.inputRefs.picker.togglePicker() on Android

Created on 16 May 2018  路  17Comments  路  Source: lawnstarter/react-native-picker-select

I am using your example on an Android and noticed that I cannot call 'this.inputRefs.picker.togglePicker() ' to the reference created in the example. This works perfectly for IOS but not Android.

enhancement

Most helpful comment

Same request here - any updates?

All 17 comments

I'll take a look

I have the same issue, cannot open modal when calling 'this.inputRefs.picker.togglePicker() ' .

@kholiavko-roman is correct. would need a workaround to trigger the picker programmatically on android.

closing this issue as it will live in the feature request board

Hm, I think this may be fixed by https://github.com/lawnstarter/react-native-picker-select/pull/107, since this was my primary goal when adding forwardRef. 馃

@lfkwtz do we have an update on this?

No. Same issue exists - using the native Android Picker element exposes no API to programmatically trigger the Picker. There may be a hacky way to simulate it - but I haven't thought too much about it.

any update on this? It would be great to make it work!

I haven't looked into it recently. Open to prs.

any updates on this?

Still not working... maybe the hacky way?

This is not related to react-native. I can call the ref.current.togglePicker() and I can see the showPicker state changing from true to false and vice-versa. This is because the togglePicker has nothing to do with android, it only changes the showPicker but that's not really being used by android as seen here https://github.com/lawnstarter/react-native-picker-select/blob/71ba0b5781f9f3885261e9bce400aefb44c1ac71/src/index.js#L511-L534 so it doesn't matter if you call that, so how do we manually toggle the picker on android?

Any update on this?

Same request here - any updates?

any updates ?

Open to PRs. I won't be looking into this anytime soon.

Was this page helpful?
0 / 5 - 0 ratings