File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -340,7 +340,7 @@ const PropertyMap: FC<PropertyMapProps> = ({
340
340
useEffect ( ( ) => {
341
341
if ( ! map ) return ;
342
342
if ( ! selectedProperty ) {
343
- // setPopupInfo(null);
343
+ setPopupInfo ( null ) ;
344
344
if ( window . innerWidth < 640 && prevCoordinate ) {
345
345
map . setCenter ( prevCoordinate as LngLatLike ) ;
346
346
setPrevCoordinate ( ) ;
@@ -423,6 +423,11 @@ const PropertyMap: FC<PropertyMapProps> = ({
423
423
e . target . getCanvas ( ) . style . cursor = cursorType ;
424
424
} ;
425
425
426
+ const handlePopupClose = ( ) => {
427
+ setSelectedProperty ( null ) ;
428
+ setPopupInfo ( null ) ;
429
+ } ;
430
+
426
431
// map load
427
432
return (
428
433
< div className = "customized-map relative max-sm:min-h-[calc(100svh-100px)] max-sm:max-h-[calc(100svh-100px) h-full overflow-auto w-full" >
@@ -515,7 +520,7 @@ const PropertyMap: FC<PropertyMapProps> = ({
515
520
longitude = { popupInfo . longitude }
516
521
latitude = { popupInfo . latitude }
517
522
closeOnClick = { false }
518
- onClose = { ( ) => setPopupInfo ( null ) }
523
+ onClose = { handlePopupClose }
519
524
>
520
525
< div className = "flex flex-row items-center nowrap space-x-1" >
521
526
< span > { toTitleCase ( popupInfo . feature . address ) } </ span >
You can’t perform that action at this time.
0 commit comments