Skip to content
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

autoFocus input not working within dialog #319

Open
SamKirkland opened this issue Nov 16, 2022 · 0 comments
Open

autoFocus input not working within dialog #319

SamKirkland opened this issue Nov 16, 2022 · 0 comments

Comments

@SamKirkland
Copy link

When using <input autoFocus /> within a modal the input will not be focused because the modal captures focus.
See library code examples or live examples

Appears to be due to focus capture implemented on first render

sentinelStartRef.current.focus();

It might make sense to switch to dialog instead https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog as browser support is solid https://caniuse.com/?search=dialog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant