fateh999 / react-native-paper-dropdown

Dropdown using react native paper TextInput and Menu
MIT License
130 stars 74 forks source link

Why is the value an empty string after resetting the menu? #113

Closed Volper212 closed 1 month ago

Volper212 commented 1 month ago

Since value is string | undefined, I think that undefined should be the value when the menu of a Dropdown is reset, not an empty string. It makes no sense to me that "" indicates no value when the types clearly state that the value can be undefined. It's a way to get a bug without noticing it - someone might not expect an empty string to be passed to select, thinking that undefined is the value when nothing is selected. A user's code might then assume that a proper option with value set to "" was selected and throw an unexpected error because of that instead of discarding it as a non-value if it was undefined.

fateh999 commented 1 month ago

Should be fixed in v2.3.1