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
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
dialog/src/Dialog/Content/Panel.tsx
Line 56 in 4f70824
It might make sense to switch to
dialoginstead https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialog as browser support is solid https://caniuse.com/?search=dialog