Skip to content

fix(ios): marker onPress not firing after navigation back#60

Merged
lodev09 merged 1 commit intomainfrom
fix/ios-marker-press-after-navigation
Mar 26, 2026
Merged

fix(ios): marker onPress not firing after navigation back#60
lodev09 merged 1 commit intomainfrom
fix/ios-marker-press-after-navigation

Conversation

@lodev09
Copy link
Copy Markdown
Collaborator

@lodev09 lodev09 commented Mar 26, 2026

Summary

On iOS, MKMapView only fires didSelectAnnotationView: when an annotation transitions from deselected → selected. If a marker stays selected after navigating away and returning, re-tapping it never fires the delegate — so onPress is silently swallowed.

This PR moves press event emission from didSelectAnnotationView: to the existing tap gesture recognizer on annotation views, which fires on every tap regardless of selection state.

  • Bug fix

Test Plan

  • Press a marker → navigates to detail screen
  • Go back → press the same marker again
  • Verify onPress fires every time
  • Verify callouts (bubbled and non-bubbled) still work correctly
  • Verify centerOnPress still works

Checklist

  • I tested on iOS
  • I tested on Android
  • I tested on Web
  • I updated the documentation (if needed)

Closes #58

Move press event emission from didSelectAnnotationView: to the
existing tap gesture recognizer on annotation views. MKMapView only
fires didSelectAnnotationView: when an annotation transitions from
deselected to selected — if a marker stays selected after navigating
away and back, re-tapping it never fires the delegate. The tap gesture
fires on every tap regardless of selection state.

Also adds navigation to both example apps (expo-router + react-navigation)
with a navigate marker type to reproduce and verify the fix.

Closes #58
@lodev09 lodev09 merged commit 8aa0a49 into main Mar 26, 2026
3 checks passed
@lodev09 lodev09 deleted the fix/ios-marker-press-after-navigation branch March 26, 2026 17:06
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

Successfully merging this pull request may close these issues.

Marker onPress stops firing after navigation and returning to map

1 participant