question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is it possible to trigger the Picker from another onPress handler?

See original GitHub issue

We render the Picker as a field in a list. We would like to trigger the picker to open when the Row has been tapped. Is there a way to do this?

I can see that within the Picker.ios.js component, there is the following method:

  _setModalVisible(visible) {
    this.setState({ modalVisible: visible });
  }

Would it be possible to expose this method? Or at least a prop that we can pass in to trigger the Picker to open?

We’re using native-base 2.3.5

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
akhil-gacommented, Jan 5, 2018

@jync you can fork NativeBase and make the required changes to achieve what you want.

0reactions
bjornbreckcommented, Oct 17, 2021

Has there been any updates to this? It seems like a very critical piece of functionality left out of core… 😞

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native: onPress triggering another onPress
1 Answer 1 ... On Android, You can set the prop mode="dropdown" to show a dropdown anchored to the picker view. That renders...
Read more >
How to use react-native-picker-select - LogRocket Blog
Android users can force it to use an unstyled TextInput by passing false to the useNativeAndroidPickerStyle prop. Further customization can now ...
Read more >
Difference between addEventListener and onclick in JavaScript
The addEventListener() and onclick both listen for an event. Both can execute a callback function when a button is clicked.
Read more >
react native picker open programmatically
Click on Button to Call Custom Function React onClick event handler is very much useful when we required to perform a particular action....
Read more >
How To Trigger Button Click on Enter - W3Schools
Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found