Comments (10)
Hi,
here is an example with isFormValid
function. It disables submit button on invalid state case
from react-form-validator-core.
In my form it showing false even if i fill all the required fields.
from react-form-validator-core.
on onError isn't firing :(
from react-form-validator-core.
But it works in example. Maybe you have some issue in your form logic
from react-form-validator-core.
Yeah, I didn't used validateListener, my bad.
from react-form-validator-core.
this.setState({ isFormValid: this.form.isFormValid() }) this works in some cases and others it throws error
Uncaught TypeError: _ValidationRules2.default[name] is not a function
from react-form-validator-core.
Can you reproduce it here?
from react-form-validator-core.
Hi @NewOldMax Can you check this example
Here I have used PureComponent and handleError = () => { this.setState({ disabled: !this.form.isFormValid(false) }); };
When i type something, the pages becomes unresponsive, can you help me with why this is happening.
from react-form-validator-core.
I think the problem in your example is that you're using handleError
as both the form onError
handler and also the validatorListener
on the field. If you use isFormValid()
instead of isFormValid(false)
it seems to work ok.
When you call isFormValid(false)
that causes the validatorListener to be called on each field and since validatorListener is calling isFormValid
you get into an infinite loop.
I haven't seen that other error you mentioned (Uncaught TypeError: _ValidationRules2.default[name] is not a function) in your example after changing the isFormValid(false)
to isFormValid()
.
from react-form-validator-core.
Since isFormValid
was changed, this issue is not acceptable anymore
from react-form-validator-core.
Related Issues (20)
- Is there a way to avoid propagation when having nested forms? HOT 1
- Remove (or make optional) create-react-context dependency
- Uncaught TypeError: _this.props.validatorListener is not a function HOT 1
- Unhandled Promise Rejection on using resetValidations() HOT 1
- Why does it that isFormValid delayed? HOT 2
- Problem with RegEx flags HOT 1
- Update README HOT 1
- Filevalidator: File validation is not working properly HOT 3
- Warning: Legacy context API has been detected within a strict-mode tree. HOT 1
- support "endAdornment" ? HOT 1
- Validation fails for optional TextValidator with min/max string lengths HOT 2
- TypeError: Cannot read property 'Consumer' of undefined - v1.0.0 HOT 2
- Uncaught TypeError: Cannot read property 'attachToForm' of undefined HOT 1
- Add file extension validation and correct name for current file extension validation
- Need Textarea validation HOT 1
- IsPositive accepts 0 while 0 is not a positive number
- Peer dependency for react 17 HOT 1
- Custom validation name should not contain colon ':' HOT 6
- remote validation
- Polyfill library throwing react-17 dependency warning HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-form-validator-core.