[Form] validateTrigger not working with values other than onChange
See original GitHub issueVersion
2.11.1
Environment
Chrome 59.0.3071.104 / Windows 10 64-bits
Reproduction link
https://codepen.io/anon/pen/awmVjK?editors=0010
Steps to reproduce
- Type something in both inputs
- Observe the green mark appearing as you type on the right-hand side of the inputs
What is expected?
The inputs should not be validated until a blur
event happens for the first input, while the other should never be validated (the validateTrigger
option’s values are onBlur
and false
, respectively).
What is actually happening?
Both inputs are validated as you type, as if the value for the validateTrigger
option was the default onChange
.
Weirdly, if you type something in the first input, then delete everything you’ve just typed and unfocus the input, it will start working properly (the input will only be validated as you blur).
I’m trying to setup a form that only displays errors/valid marks when the users clicks on the submit button, not as the user types.
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
Ant design Form validateTrigger change dynamically from ...
This type of validation has worked for me: <FormItem {...formItemLayout} label="E-mail" hasFeedback > {getFieldDecorator('email', ...
Read more >validateTrigger.js - example - rc-form@2.4.12 - react-component
use validateTrigger config ... email validate onBlur && onChange ... formShape } from 'rc-form'; import React, { Component } from 'react'; import ReactDOM ......
Read more >Form - Ant Design
High performance Form component with data scope management. Including data collection, verification, and styles.
Read more >ant-design/ant-design-english - Gitter
hi all - I'd like to have a form validation trigger pattern that is initially onBlur, then onChange after the first validation fail,...
Read more >Antd: How To Validate Form Items Values Has Been Changed
Includes layout initial values validation and submit. import { Form Input ... [Form] validateTrigger not working with values other than onChange # The ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@acomito Try this, it works for me
It would be nice to be able to add it per rule: