I created a modal in which I have a textinput, to carry out the search, a scrollview which instantly displays this search. the scrollview map on touchopacity and the problem is that I find myself clicking twice on a choice instead of only once, how to remedy this?
I have already tried Keyboard.dismiss() in my handleselectitem function;
add a keyboardShouldPersistTaps={true} to the scrollview and even to the modal
<ScrollView keyboardShouldPersistTaps="always">
{results?.map((result, index) => (
<TouchableOpacity key={index} onPress={() => handleSelectItem(result)} disabled={isDisabled}>
<View >
<CustomText fontSize={14} fontWeight={"bold"} color={colors.black} style={{ marginLeft: 12 }}>
{isCity ? result.clientinfos : result.civility ? `${result.civility} ${result.nom}` : result.nom}
</CustomText>
{result.category && (
<CustomText fontSize={14} color={colors.black} style={{ marginLeft: 12 }}>
{result.category}
</CustomText>
)}
{result.address && (
<CustomText fontSize={14} fontWeight={'bold'} color={colors.gray} style={{ marginLeft: 12 }}>
{result.address}
</CustomText>
)}
{result.zip && result.city && (
<CustomText fontSize={14} color={colors.black} style={{ marginLeft: 12 }}>
{result.zip},{result.city}
</CustomText>
)}
{result.tel && (
<CustomText fontSize={16} color={colors.black} style={{ marginLeft: 12 }}>
{result.tel}
</CustomText>
)}
<View style={styles.divider} />
</View>
</TouchableOpacity>
))}
</ScrollView>