react-native-modal-dropdown icon indicating copy to clipboard operation
react-native-modal-dropdown copied to clipboard

How do i call the show method? Kindly help

Open patrickkabwe opened this issue 3 years ago • 7 comments

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

patrickkabwe avatar Mar 03 '21 18:03 patrickkabwe

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

donni106 avatar Mar 05 '21 00:03 donni106

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

smriti-spotnana avatar May 08 '21 10:05 smriti-spotnana

@smriti-spotnana Any suggestion?

patrickkabwe avatar May 08 '21 10:05 patrickkabwe

Nope, I couldn't figure out myself ..

smriti-spotnana avatar May 08 '21 10:05 smriti-spotnana

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.

donni106 avatar May 12 '21 09:05 donni106

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

jayarajm avatar Jul 20 '21 11:07 jayarajm

const dropdownRef = useRef();

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

gorbs avatar Aug 02 '21 12:08 gorbs