You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Makes sense. I'd say that "the convenience and simplicity of autoFocus" is really not significantly greater than typing a valid selector for the component you want to focus — but if that's how you like to do it, I understand. Open to a PR making this autoFocus-compatible.
@matthewoates With the latest update to focus-trap, autoFocus does in fact work. I added a demo showing this and a note to the README explaining the one caveat I've seen.
You get
autoFocus
for free. My understanding is that whenever a focusable element withautoFocus
is added by react, it automatically gets focused.autoFocus
doesn't work right now with focus-trap-react.initialFocus
is unspecified, it ignores anyautoFocus
elements and focuses the first element.focus-trap-react
throws an error and breaks the component.autoFocus
in the first placeThe text was updated successfully, but these errors were encountered: