n4kz / react-native-material-dropdown

Material dropdown with consistent behaviour on iOS and Android
Other
732 stars 597 forks source link

.blur() does not work #193

Open khuang-citylift opened 4 years ago

khuang-citylift commented 4 years ago

The problem I am having is that when I have a react-native-material-dropdown open, and the login session times out (will navigate to another screen), the dropdown from the previous screen remains open.

Image showing the dropdown remains focused on next screen even though the component is no longer mounted:

Screen Shot 2019-11-18 at 4 08 59 PM

I am using React refs to close the dropdowns:

componentWillUnmount() {
        this.dropdownMakesRef.current.blur();
        this.dropdownModelsRef.current.blur();
        this.dropdownYearsRef.current.blur();
    } 

componentWillUnmount does get called but the dropdowns do not get closed upon screen navigation. If anyone has any ideas on how to troubleshoot this, please let me know.

Thanks