We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7c9a583 commit d2b9045Copy full SHA for d2b9045
src/use-dropdown-menu.ts
@@ -55,13 +55,13 @@ export default function useDropdownMenu(itemCount: number) {
55
56
// Handle listening for clicks and auto-hiding the menu
57
useEffect(() => {
58
+ // Ignore if the menu isn't open
59
+ if (!isOpen) {
60
+ return;
61
+ }
62
+
63
// This function is designed to handle every click
64
const handleEveryClick = (event: MouseEvent) => {
- // Ignore if the menu isn't open
- if (!isOpen) {
- return;
- }
-
65
// Make this happen asynchronously
66
setTimeout(() => {
67
// Type guard
0 commit comments