Pattern-Projector / pattern-projector

https://www.patternprojector.com/
MIT License
27 stars 13 forks source link

Close overlay menu on click outside #290

Closed Nifdee closed 1 week ago

Nifdee commented 2 weeks ago

Pull Request Checklist

Description

I don't fully understand the cause, but clicks outside the overlay options menu would only trigger the mousedown event when the click was inside the header - not when it was on the main part of the page where the PDF gets rendered. The pointerdown event, however, does get triggered everywhere so this PR switches to using that event everywhere. Since there are three dropdown components that all run the same logic, I've extracted a hook for this.

Related Issues

Fixes https://github.com/Pattern-Projector/pattern-projector/issues/262

TODO

vercel[bot] commented 2 weeks ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
pattern-projector ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 21, 2024 6:29pm
courtneypattison commented 1 week ago

You're on fire!!! Thank you! Looks excellent as usual.