how to set onBlur for Listbox (formik) #2396
Unanswered
Tomekmularczyk
asked this question in
Help
Replies: 1 comment 2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using Formik and Listbox component. I don't know how to properly set onBlur to trigger validation at the correct time.
I tried to set it on Listbox.Options but notice that when you select element from the list, for a split of the second Select turns red - as if was invalid. That happens right at the time when you select the item.
https://codesandbox.io/s/sleepy-wave-qsye7w?file=/src/Select.js
The way it should work:
Given that a Select is required, validation should trigger when user clicks on the Select, but does not select any item.
If user clicks on the Select and selects item from the list no error state should be visible.
Seems to me like this has to be fixed on the library side. Help.
Screen.Recording.2023-03-23.at.13.32.41.mov
Beta Was this translation helpful? Give feedback.
All reactions