-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Calling onBlur for field using an event object causes value to change #2189
Comments
I have the same problem... Did you find a solution ? I have a address field using Google Maps' autocomplete API. When an address is selected, I update manually the field value using this.props.input.onChange(). The field value is then an object instead of a string. It seems very weird that onBlur would change the field value. Definitely not something I would have expected. |
Looks like this is a known issue: #2768 |
Because this issue saw almost no activity for a few months, I'm closing it. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I've got a form with
body
field usingredux-form
.I've got a mentions component that only renders when form field is focused.
I've omitted
redux-form
's defaultonBlur
prop from being spread over my Textarea so that when the mentions component is clicked the field does not lose focus. I've replaced this withreact-onclickoutside
so that the field will only lose focus when a click happens outside the component.Code: (Only showing relevant stuff)
Here is the situation:
form is rendered twice (using separate names).
Form A is in focus with value 'VALUE'
a click on form B triggers the handleClickOutside handler on form A
Form A received the value from form B.
From what I can tell
onBlur
is inspecting the event object and using the target value in it to set the value of the current form, in this case though the target is a different form. What is the point of onBlur changing a forms value? Why is this default behavior? I fixed this by not passing onBlur anything but this seems pretty weird IMOthoughts?
The text was updated successfully, but these errors were encountered: