-
-
Notifications
You must be signed in to change notification settings - Fork 58
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
MarkerView with TouchableOpacity (and other Touchable) - onPress Not Triggering on Android #557
Comments
Thanks for the report, can you also reproduce with the latest beta version? Are you using the old or new architecture? |
Sorry, I should have said - this is with the new architecture. I haven't tried with new architecture disabled and I haven't tried with beta - I'll try now. |
Here is what I have found from testing with old and new architecture on 10.0.0-alpha.28 and 10.0.0-beta.8: 10.0.0-alpha.28 with old architecture: no problem 10.0.0-beta.8 with old architecture: no problem |
Did you still only try on Android? |
Yes, I'll try on iOS now |
Apologies for the delay. Yes I am seeing the same as above on iOS |
I can't reproduce within your repository. You are build your dev client on EAS? Did you build your dev client from that same repository or another repository? Are you using the correct dev clients? This is how I tried to reproduce:
Everything works as expected. I've also tried within our example app like this, which also works fine: import { MapView, MarkerView } from "@maplibre/maplibre-react-native";
import { StyleSheet, Text, TouchableOpacity } from "react-native";
import { sheet } from "../styles/sheet";
const styles = StyleSheet.create({
touchable: {
padding: 16,
width: 128,
backgroundColor: "white",
},
});
export default function BugReport() {
return (
<MapView style={sheet.matchParent}>
<MarkerView coordinate={[0, 0]}>
<TouchableOpacity
style={styles.touchable}
onPress={() => console.log("Marker clicked")}
>
<Text>Touchable</Text>
</TouchableOpacity>
</MarkerView>
</MapView>
);
} |
Thanks for taking the time to look into this. Yes I'm using EAS and I'm building the dev client fresh from the repository linked above. I'm a bit stumped now - I'm not sure what I should try next - do you have any ideas? |
Did you rebuild your EAS client after every change in architecture and app version? Downloaded that client and tested the bug example again? Can you try if it works for you too, if you build locally as I did in your repo? You can also try the example in this repo:
|
Yes I rebuilt the dev client for each architecture & version permutation. I'll try building locally and let you know how it goes. |
Thanks for clarifications! If it works for you with the local build, you could also try It's yet unclear to me, how this could only happen with a EAS build. |
Very strange. I have built my repo locally to Android (@maplibre/maplibre-react-native ^10.0.0-beta.9) and I still experience the same issue. When tapping the marker the onPress (i.e. console.log("Marker clicked")) does not execute. |
Yes, I see the |
Yes I've only been testing on real devices |
Could you verify, that it's working within emulator/simulator? Thanks! |
Ah, yes it does work within simulator. |
Have you been able to reproduce the issue on a real device? Can I provide any further details? |
I've been playing around with it and it works (including real devices) using onPressOut instead of onPress |
Can confirm the event isn't riggered on Android device. |
But I can't reproduce on iOS, not 100% sure if build correctly on new arch. On Android we might have to do this migration: reactwg/react-native-new-architecture#154 (reply in thread). |
Actually we might be experiencing this? If I press and drag in the Android emulator I can also reproduce the bug. facebook/react-native#44610 (comment) |
I have been using MapLibreGL.MarkerView successfully for some time, and the press events from child elements worked fine on both iOS and Android. However, after upgrading my project to Expo SDK 52, the MarkerView on Android no longer triggers the onPress event. Tapping the marker appears to do nothing, even though the same code worked prior to the upgrade. I haven't fully tested on iOS yet.
Steps to Trigger Behavior
Link to Minimal Reproducible Example
https://github.com/stharvey/maplibre-test
Expected Behavior
Tapping the marker should trigger the onPress callback and log "Marker clicked" to the console.
Actual Behavior
On Android, tapping the marker does nothing.
Environment
@maplibre/maplibre-react-native
Version: 10.0.0-alpha.28react-native
Version: 0.76.5expo
Version: 52.0.18The text was updated successfully, but these errors were encountered: