Conversation
mholtzman
left a comment
There was a problem hiding this comment.
just a couple more nitpicks
| const useFocusableRef = (focus) => { | ||
| const ref = useRef(null) | ||
|
|
||
| useEffect(() => { |
There was a problem hiding this comment.
can probably just wrap this whole thing in an if (focus) so we dont need to invoke the hook and can get rid of the other conditional logic
There was a problem hiding this comment.
Wrapping the useEffect in an if caused a React error, moving this if(focus) inside the hook does the trick and looks cleaner howver!
I have also added the delay parameter back as I realised on the initial input we can focus much quicker as there is no animation.
There was a problem hiding this comment.
ahh interesting, didn't know that. looks good!
mholtzman
left a comment
There was a problem hiding this comment.
lgtm. can you add a few of these focus type cases to the testing tickets?
| const useFocusableRef = (focus) => { | ||
| const ref = useRef(null) | ||
|
|
||
| useEffect(() => { |
There was a problem hiding this comment.
ahh interesting, didn't know that. looks good!
* useConditionalAutofocus hook * allow password submission immediately if no errors * empty the mouth * increase timeout so that the styling isnt messed up, renaming, apply useEffect * tidy up, add back delay param
No description provided.