javascript - Input type password field wasn't submitted with Enter -


i have redux-form 2 input fields, first 1 of type text , second of type password. can see code here:

<div classname="input-box">             <field               id="username"               name="username"               type="text"               placeholder="username"               component={inputfield}             />           </div>           <div classname="input-box">             <field               id="password"               name="password"               type="password"               placeholder="password"               component={inputfield}             /> 

i've add validators container this:

const validate = (values) => {   const errors = {};    if (!values.get('username')) {     errors.username = 'username required';   }   if (!values.get('password')) {     errors.password = 'password required';   }   return errors; }; 

my problem when press enter button if password field filled validator password triggered. when click button has type submit form submitted successfully. why that?


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -