Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do i call the show method? Kindly help #21

Open
patrickkabwe opened this issue Mar 3, 2021 · 7 comments
Open

How do i call the show method? Kindly help #21

patrickkabwe opened this issue Mar 3, 2021 · 7 comments

Comments

@patrickkabwe
Copy link

patrickkabwe commented Mar 3, 2021

Screenshot 2021-03-05 at 6 25 25 AM

Hi donni106,
Thanks for following up,
In the above image there is a show( ) method which triggers the dropdown Modal to show.
My question was how can i call the show( ) method in a case where i am using a custom Icon to display the dropdown modal?
Thank you

@donni106
Copy link
Contributor

donni106 commented Mar 5, 2021

can you elaborate a bit more please what you need to know

@smriti-spotnana
Copy link

I think they want to know how to call the show() method manually? - rather than lib calling it itself

@patrickkabwe
Copy link
Author

@smriti-spotnana Any suggestion?

@smriti-spotnana
Copy link

Nope, I couldn't figure out myself ..

@donni106
Copy link
Contributor

Please have a look in the examples, there you can find one for using show() (dropdown_5).

Code for examples with Expo: https://github.com/siemiatj/react-native-modal-dropdown/blob/master/expo-example/App.js
Code for examples without Expo: https://github.com/siemiatj/react-native-modal-dropdown/blob/master/example/index.js

You can also try the examples running on a phone or simulator.

@jayarajm
Copy link

Yes I can call show(), But the drop is not open. I hope the fullscreen overlay is coming but dropdown is not open.

@gorbs
Copy link

gorbs commented Aug 2, 2021

const dropdownRef = useRef();

return (
<View>
<Button title="press" onPress={() => dropdownRef.current.show()} />
<ModalDropdown
  ref={dropdownRef}
  options={['aaa','bbb','ccc']}
/> 
</View>
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants