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 69a25ca commit 7c9a583Copy full SHA for 7c9a583
src/use-dropdown-menu.ts
@@ -80,7 +80,10 @@ export default function useDropdownMenu(itemCount: number) {
80
};
81
82
// Add listener
83
- document.addEventListener('click', handleEveryClick);
+ // -> Force it to be async to fix: https://github.com/facebook/react/issues/20074
84
+ setTimeout(() => {
85
+ document.addEventListener('click', handleEveryClick);
86
+ }, 1);
87
88
// Return function to remove listener
89
return () => document.removeEventListener('click', handleEveryClick);
0 commit comments