planet-webapp icon indicating copy to clipboard operation
planet-webapp copied to clipboard

Add click outside handler to close time travel dropdown

Open coderabbitai[bot] opened this issue 9 months ago • 1 comments
trafficstars

Context

The time travel dropdown in the project map should close when clicking outside of it to improve user experience.

Implementation Details

  • Add click outside handler using useEffect and useRef hooks
  • Close the dropdown when clicking outside of the dropdown container
  • Clean up event listener on component unmount

References

  • PR: #2329
  • Comment: https://github.com/Plant-for-the-Planet-org/planet-webapp/pull/2329#discussion_r1924925010

coderabbitai[bot] avatar Jan 23 '25 06:01 coderabbitai[bot]