File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -338,7 +338,7 @@ const PropertyMap: FC<PropertyMapProps> = ({
338338 useEffect ( ( ) => {
339339 if ( ! map ) return ;
340340 if ( ! selectedProperty ) {
341- // setPopupInfo(null);
341+ setPopupInfo ( null ) ;
342342 if ( window . innerWidth < 640 && prevCoordinate ) {
343343 map . setCenter ( prevCoordinate as LngLatLike ) ;
344344 setPrevCoordinate ( ) ;
@@ -421,6 +421,12 @@ const PropertyMap: FC<PropertyMapProps> = ({
421421 e . target . getCanvas ( ) . style . cursor = cursorType ;
422422 } ;
423423
424+ const handlePopupClose = ( ) => {
425+ setSelectedProperty ( null ) ;
426+ setPopupInfo ( null ) ;
427+ history . replaceState ( null , '' , `/find-properties` ) ;
428+ } ;
429+
424430 // map load
425431 return (
426432 < 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" >
@@ -514,7 +520,7 @@ const PropertyMap: FC<PropertyMapProps> = ({
514520 longitude = { popupInfo . longitude }
515521 latitude = { popupInfo . latitude }
516522 closeOnClick = { false }
517- onClose = { ( ) => setPopupInfo ( null ) }
523+ onClose = { handlePopupClose }
518524 >
519525 < div className = "flex flex-row items-center nowrap space-x-1" >
520526 < span > { toTitleCase ( popupInfo . feature . address ) } </ span >
You can’t perform that action at this time.
0 commit comments