You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently certain TouchableOpacity components are not clickable within modals. In our experience, Android and iOS need to use different imports - one from react-native and one from react-native-gesture-handler.
I didn't want to switch away from this lib so I created a simple patch to inject a custom TouchableOpacity component. Posting here in case it's useful to anyone else.
renders.js changes:
// ...// Link component:link: (node: LinkNode,output: OutputFunction,state: RenderState,styles: RenderStyles)=>{constonPress=state.onLinkPress///// Patch starts here: switch to TouchableOpacity from react-native-gesture-handler if neededreturn<styles.TouchableOpacity.Componentkey={state.key}onPress={onPress ? ()=>onPress(node.target) : null}><Textstyle={[styles.link,{bottom:-4}]}>{typeofnode.content==='string' ? node.content : output(node.content,state)}</Text></styles.TouchableOpacity.Component>///// PATCH ENDS HERE},
Setting markdown styles in our code:
link: { color: theme.clickableLinkColor, fontSize: HELP_FONT_SIZE },
// Inject element that can be clicked in a modal
TouchableOpacity: { Component: isIOS
? TouchableOpacityRngh // from react-native-gesture-handler
: TouchableOpacityRN; // from RN
},
The text was updated successfully, but these errors were encountered:
Recently certain
TouchableOpacity
components are not clickable within modals. In our experience, Android and iOS need to use different imports - one fromreact-native
and one fromreact-native-gesture-handler
.I didn't want to switch away from this lib so I created a simple patch to inject a custom TouchableOpacity component. Posting here in case it's useful to anyone else.
renders.js changes:
Setting markdown styles in our code:
The text was updated successfully, but these errors were encountered: