Availity / availity-reactstrap-validation

Easy to use React validation components compatible for reactstrap.
https://availity.github.io/availity-reactstrap-validation/
MIT License
191 stars 70 forks source link

focus AvInput on load #195

Closed mstruensee closed 4 years ago

mstruensee commented 4 years ago

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 4 years ago

what about autofocus? https://developer.mozilla.org/en-US/docs/Web/API/HTMLSelectElement/autofocus

mstruensee commented 4 years ago

:doh: guess I was overthinking it ... thanks!