Skip to content

Commit 8fa883c

Browse files
committed
fix: Add timeout in programmaticFocus
1 parent 4c5d4bc commit 8fa883c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/util.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
export function programmaticFocus (el) {
1+
export function programmaticFocus (el, timeout = 1000) {
22
el.setAttribute('tabindex', '-1')
33
el.focus()
4-
el.removeAttribute('tabindex')
4+
setTimeout(() => el.removeAttribute('tabindex'), timeout)
55
}

0 commit comments

Comments
 (0)