Skip to content

Commit c8ff82f

Browse files
authored
fix: better handling for clickable prop in AdvancedMarker (#906)
1 parent db42d82 commit c8ff82f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/components/advanced-marker.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,11 +300,12 @@ function useAdvancedMarker(props: AdvancedMarkerProps) {
300300
useEffect(() => {
301301
if (!marker) return;
302302

303+
// when clickable is defined, we will always use its value for gmpClickable.
304+
// otherwise we auto-detect based on existing event-handlers.
303305
const gmpClickable =
304-
clickable !== undefined ||
305-
Boolean(onClick) ||
306-
Boolean(onMouseEnter) ||
307-
Boolean(onMouseLeave);
306+
clickable !== undefined
307+
? clickable
308+
: Boolean(onClick) || Boolean(onMouseEnter) || Boolean(onMouseLeave);
308309

309310
// gmpClickable is only available in beta version of the
310311
// maps api (as of 2024-10-10)

0 commit comments

Comments
 (0)