Skip to content

Commit

Permalink
fix: focus raf times
Browse files Browse the repository at this point in the history
  • Loading branch information
MadCcc committed Apr 28, 2022
1 parent c492684 commit 1a10e78
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/examples/simple.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export default function Simple() {
<div style={{ height: 100 }} />
<div>
<Dropdown
autoFocus
trigger={['click']}
overlay={menu}
animation="slide-up"
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useAccessibility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default function useAccessibility({
window.addEventListener('keydown', handleKeyDown);
if (autoFocus) {
// FIXME: hack with raf
raf(focusMenu);
raf(focusMenu, 3);
}
return () => {
window.removeEventListener('keydown', handleKeyDown);
Expand Down

0 comments on commit 1a10e78

Please sign in to comment.