Skip to content

Commit 1a10e78

Browse files
committed
fix: focus raf times
1 parent c492684 commit 1a10e78

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

docs/examples/simple.jsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ export default function Simple() {
2727
<div style={{ height: 100 }} />
2828
<div>
2929
<Dropdown
30+
autoFocus
3031
trigger={['click']}
3132
overlay={menu}
3233
animation="slide-up"

src/hooks/useAccessibility.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export default function useAccessibility({
5959
window.addEventListener('keydown', handleKeyDown);
6060
if (autoFocus) {
6161
// FIXME: hack with raf
62-
raf(focusMenu);
62+
raf(focusMenu, 3);
6363
}
6464
return () => {
6565
window.removeEventListener('keydown', handleKeyDown);

0 commit comments

Comments
 (0)