Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropdown click issue when view is child of GestureHandlerRootView using react-native-element-dropdown #314

Open
Zunaira-Haroon opened this issue Nov 18, 2024 · 1 comment

Comments

@Zunaira-Haroon
Copy link

App.tsx

Main File: 
 <Animated.ScrollView
        nestedScrollEnabled
        scrollEventThrottle={16}
        onScroll={scrollHandler}
        showsVerticalScrollIndicator={false}
        style={{paddingTop: height * 0.11}}>
        
        My DropDown Component

</Animated.ScrollView>

DropdownCompoent:
<Dropdown
data={data}
labelField="label"
valueField="value"
placeholder={ !isFocus ? 'Select' : '...'}
renderItem={renderItem}
value={value}
onChange={item => {
setValue(item);
setIsFocus(false);
}}
activeColor={colors?.dropDown?.selectItemBg}
fontFamily={FontFamily.InterRegular}
style={[styles.dropdown, dropdownStyle]}
containerStyle={[styles?.containerStyle]}
iconColor={colors?.text?.textMedium}
inputSearchStyle={styles.inputSearchStyle}
placeholderStyle={styles.placeholderStyle}
selectedTextStyle={[styles.selectedTextStyle]}
/>
StyleSheet.create({
dropdown: {
borderRadius: width0.02,
borderTopLeftRadius: width
0.02,
borderTopRightRadius: width0.02,
borderWidth: 1.3,
borderColor: colors?.dropDown?.border,
paddingHorizontal: width
0.03,
backgroundColor: colors?.dropDown?.bg,
height: height0.05,
},
selectedTextStyle: {
fontSize: fontSize(14),
color: colors?.dropDown?.text,
fontFamily:FontFamily.InterRegular,
fontWeight: '600'
},
placeholderStyle: {
fontSize: fontSize(14),
color: colors?.text?.textMedium,
fontFamily:FontFamily.InterRegular,
fontWeight: '400'
},
inputSearchStyle: {
display: 'none'
},
containerStyle: {
borderRadius: width
0.01,
borderWidth: 1,
borderColor: colors?.dropDown?.border,
marginVertical: width0.01,
},
renderView: {
padding: width
0.04,
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
},
renderViewAll:{
padding: width*0.04,
flexDirection: 'row',
justifyContent: 'space-between',
alignItems: 'center',
borderBottomWidth: 0.7,
borderColor: colors?.dropDown?.border,
},
renderText: {
fontSize: fontSize(16),
fontWeight: '500',
color: colors?.text?.textMedium,
fontFamily:FontFamily.InterRegular,
},
})

TouchableOpacity and others click working when it import by "import { TouchableOpacity } from "react-native-gesture-handler";
" when i import it fron react-native it doesn't work.
Same the package use the Touchable from react native, Might be (not sure) it creating conflict, and dropn down click isn't working.

My project requirement is to use gesture and Animated in parent level. how i can solve dropdown click issue?

@abbasiArbisoft
Copy link

Did you manage to fix this @Zunaira-Haroon ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants