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

app crashed when press on dropDownmodal #266

Open FatmaMahmoud698 opened 2 years ago

FatmaMahmoud698 commented 2 years ago

I hide the ModalDropdown when I show it and try to press it, all app crashed and closed I hade many dropDown in the screen , show or hide as user request

"expo": "~42.0.1",
"expo-status-bar": "~1.0.4",
"react": "16.13.1",
"react-native-modal-dropdown": "^1.0.2",
<ModalDropdown
          options={['Male', 'Female']}
              style={{
                  width: '100%',
                  borderBottomWidth: 1,
                  borderColor: '#CCCCCC',
                  paddingVertical: 10
              }}
              showsVerticalScrollIndicator={true}
              dropdownStyle={{
                  width: '80%',
                  backgroundColor: '#CCCCCC',
                  alignSelf: 'flex-end',
                  shadowRadius: 16,
                  shadowColor: 'rgba(0, 0, 0, 0)',
                  shadowOffset: { width: 1, height: 6 },
                  shadowOpacity: 0.25,
                  elevation: 2,
                  marginTop: -20,
                  height: 'auto'
              }}
              dropdownTextStyle={{
                  fontSize: 16,
                  textAlign: 'left',
                  color: 'rgba(0, 0, 0, 1)',
              }}
              textStyle={{ fontSize: 16, color: '#424242', }}
              defaultValue="Select your Gender"
              onSelect={(index)=>console.log(index)}
          />
Mohammad-Khalid commented 2 years ago

@FatmaMahmoud698 Had you been able to resolve this issue? as I'm also getting the same issue.

FatmaMahmoud698 commented 2 years ago

the issue solved when I changed this line height: 'auto' to be height: 300 @Mohammad-Khalid

Mohammad-Khalid commented 2 years ago

@FatmaMahmoud698 Thank you, it really helped

urvidparmar commented 2 years ago

Please use 1.0.2 version , it's working fine for me.