Skip to content
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 setRequired(false) makes the field required #961

Closed
Fl0w3D opened this issue May 13, 2020 · 4 comments
Closed

Calling setRequired(false) makes the field required #961

Fl0w3D opened this issue May 13, 2020 · 4 comments
Assignees
Labels
Milestone

Comments

@Fl0w3D
Copy link

Fl0w3D commented May 13, 2020

If I call setRequired with the parameter "false", setAllowBlank is also called with the value false instead of !required, resulting in a required value.
I can't see why validateOnBlur is called at all, nor why allowBlank is called with false.

@kevzlou7979
Copy link
Contributor

Ok will be looking into this on weekend.

@kevzlou7979 kevzlou7979 self-assigned this May 14, 2020
@kevzlou7979
Copy link
Contributor

Can you reproduce this issue on 2.4.0-rc1 ?

@Fl0w3D
Copy link
Author

Fl0w3D commented Aug 10, 2020

Yes, as soon as I call setRequired with the parameter false, blank value is not allowed anymore.
The explanation I wrote in my first message is still true: no matter what value is given to setRequired, the methods setValidateOnBlur and setAllowBlank are called, the first one with hard-coded parameter true, the second one with hard-coded parameter false, which disallow blank value.

@kevzlou7979 kevzlou7979 added this to the Release 2.4.0 milestone Aug 10, 2020
kevzlou7979 added a commit that referenced this issue Aug 10, 2020
@kevzlou7979
Copy link
Contributor

Ok fixed via cce5107. Added also a Unit Test

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants