New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjust types to allow initialFocus: () => undefined
#1060
Comments
@FloEdelmann You're correct! Setting the option to I'll get this sorted shortly! |
stefcameron
added a commit
that referenced
this issue
Sep 21, 2023
Fixes #1060 The option can _also_ be set to `undefined` or a function that returns `undefined`.
stefcameron
added a commit
that referenced
this issue
Sep 21, 2023
Fixes #1060 The option can _also_ be set to `undefined` or a function that returns `undefined`.
@FloEdelmann Please have a look at #1062 and LMK if the typings look good now. |
Fix published in v7.5.3 |
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
initialFocus
can beundefined
, in this case the first tabbable node will be focused. Also, we can pass a function returning an element. But we can't return undefined in that function (according to the types):focus-trap/index.d.ts
Line 12 in 94645eb
But according to the implementation, it actually works:
focus-trap/index.js
Line 270 in 94645eb
focus-trap/index.js
Lines 233 to 267 in 94645eb
So I suggest to adjust the types to allow
undefined
as a valid function return type.The text was updated successfully, but these errors were encountered: