Label of dropdown picker on controler.reset() does not reset
See original GitHub issueDescribe the bug I have two dropdowns:
const [lang, setLanguage] = useState(null);
const [lib, setLib] = useState('');
const [langOptions, setLangOptions] = useState(str.dataLanguage.en);
let languageControler;
const libraryChange = val => {
setLib(val)
let options = pickLangOptions(val)
setLangOptions(options)
}
const pickLangOptions = (lib)=>{
switch (lib) {
case 'hanoi': return str.dataLanguage.viVN;
case 'bukarest': return str.dataLanguage.enGB;
case 'newdelhi': return str.dataLanguage.enGB;
default: return str.dataLanguage.en;
}
}
<View>
<DropDownPicker
items={libraryItems}
onChangeItem={item=>{
libraryChange(item.value);
languageControler.reset()
}}
/>
</View>
<View>
<DropDownPicker
controler={ins=>languageControler=ins}
items={languageItems}
onChangeItem={item => {
setLanguage(item.value)
// console.log({item});
}}
/>
</View>
when i picked language, and then i change library, i expected the value picked to be null (which is as expected) but the label persist to be the picked language
To Reproduce as written above
Expected behavior The label should be reset as well
Info (please complete the following information):
- OS: [ Android]
- Package version [e.g. 30]
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
hossein-zare/react-native-dropdown-picker - reset the label
Describe the bug how can i reset the label of picker ? please help ... i want reset the label but i have...
Read more >react native - Reset a selectpicker by clicking on a button
According to a github issue, setting the value to null should reset the selection, but unfortunately that doesn't seem to work.
Read more >Solved: Reset field and show error - Power Platform Community
Solved: Hi Can somebody help me how to achieve this scenario: I have a date picker. in the date picker i want to...
Read more >Reset Values After A Calculation +… | Apple Developer Forums
Hello again. My app calculates as expected in every manner except that when I change the picker options, it internalizes the user input...
Read more >Form Datepicker | Components - BootstrapVue
By default, clicking on the today or reset button will also close the calendar popup, unless the prop no-close-on-select is set. Date picker...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

I reviewed your PR but is not mergeable because the reset method of the controller works well. Demo (Single): https://snack.expo.io/VVMJKW27d Demo (Multiple): https://snack.expo.io/81Idcp-y_
Please try this code:
oh right thank you. I have modified version of your multiple dropdown here that works.