You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
asyncValidate doesn't get the value from blurred field on React Native.
Your environment
Software
Version(s)
redux-form
^8.3.7
redux
^4.0.4
react-redux
^7.2.1
react
16.9.0
react-native
0.61.2
node
12.13.0
yarn if using
1.22.10
Browser
native
Operating System
android
Steps to reproduce
On a react-native environment
Create a form with a TextField.
On reduxForm() setup like:
reduxForm({name: 'formName',asyncBlurFields: ['fieldName'],asyncValidate: async(values,dispatch,props)=>{console.log({ values });// fieldName will be undefined }})
Expected behaviour
On blurring a TextField, the asyncValidate function should be called with the field value
Actual behaviour
On blurring the field, the asyncValidate function will be triggered, but the value will be undefined
Other information
The root of the cause seems to be on the file ConnectedField.js line 176. The onChangeValue returns undefined as the getValue tries to read the variable event.nativeEvent.text which does not exist on the blur event.
The text was updated successfully, but these errors were encountered:
Facing same issue with below are package version
"react": "16.11.0",
"react-native": "0.62.2",
"react-redux": "7.2.0",
"redux": "^4.0.5",
"redux-form": "8.3.6"
Observation 1 : the fields which are passing in asyncBlurFields, have undefined value, getting rest all values of form,
if using asyncChangeFields instead of asyncBlurFields I am getting values as expected on change, but I need all form values on blur.
Observation 2 : if there is multiple filedName passed in asyncBlurFields, for current active filed is empty but getting rest form values.
Subject of the issue
asyncValidate doesn't get the value from blurred field on React Native.
Your environment
redux-form
^8.3.7
redux
^4.0.4
react-redux
^7.2.1
react
16.9.0
react-native
0.61.2
node
12.13.0
yarn
if using1.22.10
native
android
Steps to reproduce
On a react-native environment
Create a form with a TextField.
On
reduxForm()
setup like:Expected behaviour
On blurring a TextField, the
asyncValidate
function should be called with the field valueActual behaviour
On blurring the field, the
asyncValidate
function will be triggered, but the value will beundefined
Other information
The root of the cause seems to be on the file ConnectedField.js line 176. The
onChangeValue
returns undefined as thegetValue
tries to read the variableevent.nativeEvent.text
which does not exist on the blur event.The text was updated successfully, but these errors were encountered: