focus AvInput on load
Closed this issue · 2 comments
mstruensee commented
is there a way to focus an input on page load, this is what I have tried, focus() exists, but its not focusing ... do I need to force a re-render inside AV??
const inputRef = useRef(null);
useEffect(() => inputRef.current.focus(), [])
<AvInput name={ "foo" } type={ "text" } required getRef={ inputRef } />
TheSharpieOne commented
what about autofocus
?
https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement/autofocus
mstruensee commented
:doh: guess I was overthinking it ... thanks!