sohobloo / react-native-modal-dropdown

A react-native dropdown/picker/selector component for both Android & iOS.
MIT License
1.19k stars 478 forks source link

reset dropdown to placeholder #233

Open TGod-Ajayi opened 4 years ago

TGod-Ajayi commented 4 years ago

I have 2 dropdowns and I want it when i select one the other changes to the placeholder and vice-versa ` <ModalDropdown
textStyle={styles.modalText} options={templatenew}

                                    defaultValue={modalButtonB}
                                    onSelect = {(index, value) => { setModalVal(value), setModalButtonB('Please Select') } }

                                    />
                                </Dropdown>
                                <Dropdown>
                                    <ModalDropdown  
                                    textStyle={styles.modalText} 
                                    options={templatenew}

                                    defaultValue={modalButtonB}

                                    onSelect = {(index, value) => { setModalVal(value), setModalButtonB('Please Select') } }

                                    />
                                </Dropdown>`
LeQuy-123 commented 3 years ago

dropdownRef.current.select(-1) it in the doc

usmanhaiderr commented 7 months ago

dropdownRef.current.select(-1) it in the doc

This is not working as it is giving error Cannot read property 'select' of undefined.