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

Some IOS versions won't fire onPress functions inside PanController #1747

Closed
lulubun opened this issue Oct 31, 2017 · 3 comments
Closed

Some IOS versions won't fire onPress functions inside PanController #1747

lulubun opened this issue Oct 31, 2017 · 3 comments

Comments

@lulubun
Copy link

lulubun commented Oct 31, 2017

react-native: 0.47.2
I'm trying to replicate the AnimatedViews from this link: https://github.com/airbnb/react-native-maps/blob/master/example/examples/AnimatedViews.js

I've got it mostly working the way I want but the buttons I've added into the AnimatedViews do not fire onPress when clicked on certain versions of IOS. After testing on all simulators:

5s - works
6 - works
6+ - works
6s - not working
6s+ - not working
7 - not working
7+ - not working
8 - not working
8+ - not working
SE - works
x - not working

I'm trying to link to a detailed screen for information about that map location when the button is pressed but somehow the PanController is the only action thing being registered. Any suggestions on how to make the button onPress a priority over the PanController? If I comment out the code for onPanYChange

onPanYChange = ({ value }) => {
console.log("onPanYChange runs", value)
const { canMoveHorizontal, region, scrollY, scrollX, markers, index } = this.state;
console.log('COORDINATE 2 ========', markers )
region.stopAnimation();
if(markers.length > 1){
region.timing({
latitude: scrollX.interpolate({
inputRange: markers.map((m, i) => i * SNAP_WIDTH),
outputRange: markers.map(m => m.location.latitude),
}),
longitude: scrollX.interpolate({
inputRange: markers.map((m, i) => i * SNAP_WIDTH),
outputRange: markers.map(m => m.location.longitude),
}),
duration: 0,
}).start();
console.log('end of coord 2')
}
}

the buttons actions are fired but the pan ability of the map is disabled.

@shopfue
Copy link

shopfue commented Nov 26, 2017

any fixes?

@lulubun
Copy link
Author

lulubun commented Nov 27, 2017

nope... anyone extra smart out there??

@shopfue
Copy link

shopfue commented Nov 27, 2017

Hey, I got a fix. It has to do with a issue regarding force touch on the newer devices and with the Panhandler.

The quickest fix is to use onPressIn instead of onPress !

Found it here

@rborn rborn closed this as completed Mar 4, 2020
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

3 participants