-
Notifications
You must be signed in to change notification settings - Fork 269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
onBlur has inconsistent behavior. #418
Comments
I'm a little blurry on the I remember adding those in order for the component to work with forms like Formik or redux-forms. The idea was that onBlur would be fired when user clicks anywhere outside of the component. This would be consistent with native web controls.
This should not trigger onBlur because the user can still be inside the component (especially in case of multiselect). Happy to be hear your thoughts. |
I agree. And I also need the onBlur for validation. However, it dos not get triggered when you click outside. It gets triggered when you close the dropdown, it don't make any difference if the select is still focused or not. In case the select is still focused (e.g. for removing some of the selected items) when you actually leave the whole input, the onBlur does not get triggered. |
Clicking outside should close the dropdown. Are you able to reproduce this in the CodeSandbox? |
yep, but there is this case:
So what i am trying to say is that the component can be on focus -off focus even if the dropdown is not triggered. does it make sense? |
Yes, I agree with you that that should be the case. |
is it ok if i'll try to fix this? i'm not to sure what's the workflow here. 😄 |
@lmotioc yes, have a go at it! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 10 days if no further activity occurs. Thank you for your contributions. |
Describe the bug
On Blur doesn't get triggered on focus out.
When a selected option is removed with the 'x'button onBlur isn't triggered, but when it is removed from the dropdown, on blur is triggered.
To Reproduce
CodeSandbox here with a console.log attached to onBlur.
Expected behavior
onBlur to be triggered on focus out.
onBlur to be triggered when removing a component with the x button
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: