Skip to content

Commit 22f53af

Browse files
authored
Fix callouts not showing on IOS (#740)
1 parent 196f6aa commit 22f53af

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

packages/maps/src/components/MapView.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,19 @@ class MapView<T> extends React.Component<
180180
}
181181

182182
// Dismiss all other callouts except the one just pressed. Maintains that only one is opened at a time
183-
private onMarkerPress(markerIdentifier: string) {
184-
for (const [idenfitifer, markerRef] of this.markerRefs) {
185-
if (idenfitifer !== markerIdentifier) markerRef.current?.hideCallout();
183+
// Web specfic, this is the default on native
184+
private dismissAllOtherCallouts(markerIdentifier: string) {
185+
if (Platform.OS === "web") {
186+
for (const [idenfitifer, markerRef] of this.markerRefs) {
187+
if (idenfitifer !== markerIdentifier) markerRef.current?.hideCallout();
188+
}
186189
}
187190
}
188191

192+
private onMarkerPress(markerIdentifier: string) {
193+
this.dismissAllOtherCallouts(markerIdentifier);
194+
}
195+
189196
private getMarkerRef(markerIdentifier: string) {
190197
if (this.markerRefs.has(markerIdentifier)) {
191198
return this.markerRefs.get(markerIdentifier);

0 commit comments

Comments
 (0)