AdelRedaa97 / react-native-select-dropdown

react-native-select-dropdown is a highly customized dropdown | select | picker | menu for react native that works for andriod and iOS platforms.
MIT License
314 stars 134 forks source link

Dropdown cannot be closed in iOS simulator #118

Closed swrobel closed 1 year ago

swrobel commented 1 year ago

I have never experienced this problem on a real device, but 100% of the time in the iOS simulator. I can't click any of the dropdown items, or click outside of the dropdown to close it. Reloading via the Metro console doesn't dismiss the dropdown - it renders on top of any other screens until the app is killed & restarted on the simulator. Here's an example of what it looks like just floating there after reloading the app via Metro (what is shown is a completely different screen than the one that even contains the dropdown): simulator_screenshot_540CE565-3670-46F3-BCCF-061A30B2C57B

AdelRedaa97 commented 1 year ago

Which version do you use for the dropdown? and do you face this problem when you use React native's Modal Component?

swrobel commented 1 year ago

select-dropdown version 3.3.0. I do not have this issue with Modals.

AdelRedaa97 commented 1 year ago

can you add the code that is in React native's documentation [https://reactnative.dev/docs/modal]() in the same screen where you add the dropdown?

AdelRedaa97 commented 1 year ago

I mean this code

const [modalVisible, setModalVisible] = useState(false);

<Modal
        animationType="slide"
        transparent={true}
        visible={modalVisible}
        onRequestClose={() => {
          Alert.alert('Modal has been closed.');
          setModalVisible(!modalVisible);
        }}>
        <View style={styles.centeredView}>
          <View style={styles.modalView}>
            <Text style={styles.modalText}>Hello World!</Text>
            <Pressable
              style={[styles.button, styles.buttonClose]}
              onPress={() => setModalVisible(!modalVisible)}>
              <Text style={styles.textStyle}>Hide Modal</Text>
            </Pressable>
          </View>
        </View>
      </Modal>
swrobel commented 1 year ago

Interesting! The modal can't be dismissed from that screen either...

AdelRedaa97 commented 1 year ago

Ok now, the problem is in the Modals, try to add this modal or the dropdown to another screen in the project may be the second screen after the splash screen to determine whether the problem is in the whole app or in this screen in particular