File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -12,14 +12,16 @@ const PlacesMarkers = function Markers() {
1212
1313 const handleClick = useCallback (
1414 ( placeId ?: string , location ?: [ number , number ] ) => {
15+ if ( selection && placeId === selection . placeId ) return ;
1516 if ( placeId ) setSelection ( { placeId, location, source : "marker" } ) ;
1617 } ,
17- [ setSelection ] ,
18+ [ selection , setSelection ] ,
1819 ) ;
1920
2021 const handleMouseOver = useCallback (
2122 ( placeId ?: string , location ?: [ number , number ] ) => {
2223 if ( placeId ) {
24+ if ( selection && placeId === selection . placeId ) return ;
2325 if ( mouseOverTimeoutRef . current )
2426 clearTimeout ( mouseOverTimeoutRef . current ) ;
2527 mouseOverTimeoutRef . current = window . setTimeout (
@@ -28,7 +30,7 @@ const PlacesMarkers = function Markers() {
2830 ) ;
2931 }
3032 } ,
31- [ setSelection ] ,
33+ [ selection , setSelection ] ,
3234 ) ;
3335
3436 const handleMouseOut = useCallback (
Original file line number Diff line number Diff line change @@ -10,9 +10,10 @@ const Markers = memo(function Markers() {
1010
1111 const handleClick = useCallback (
1212 ( placeId ?: string , location ?: [ number , number ] ) => {
13+ if ( selection && placeId === selection . placeId ) return ;
1314 if ( placeId ) setSelection ( { placeId, location, source : "marker" } ) ;
1415 } ,
15- [ setSelection ] ,
16+ [ selection , setSelection ] ,
1617 ) ;
1718
1819 const handlePopupClose = useCallback ( ( ) => {
You can’t perform that action at this time.
0 commit comments