-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Form lib] Error when validating the form with non blocking validations #102338
Labels
bug
Fixes for quality problems that affect the customer experience
Team:Kibana Management
Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
Comments
sebelga
added
the
bug
Fixes for quality problems that affect the customer experience
label
Jun 16, 2021
sebelga
added
the
Team:Kibana Management
Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
label
Jun 16, 2021
Pinging @elastic/kibana-stack-management (Team:Stack Management) |
2 tasks
2 tasks
machadoum
added a commit
to machadoum/kibana
that referenced
this issue
Jul 12, 2021
machadoum
added a commit
that referenced
this issue
Jul 13, 2021
…3629) * Fix error when validating the form with non blocking validations issue: #102338 * Add a flag to only validate blocking validation when validating the form * Refactor bypass validation Co-authored-by: Sébastien Loix <sabee77@gmail.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
machadoum
added a commit
to machadoum/kibana
that referenced
this issue
Jul 13, 2021
…stic#103629) * Fix error when validating the form with non blocking validations issue: elastic#102338 * Add a flag to only validate blocking validation when validating the form * Refactor bypass validation Co-authored-by: Sébastien Loix <sabee77@gmail.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
machadoum
added a commit
that referenced
this issue
Jul 13, 2021
…3629) (#105478) * Fix error when validating the form with non blocking validations issue: #102338 * Add a flag to only validate blocking validation when validating the form * Refactor bypass validation Co-authored-by: Sébastien Loix <sabee77@gmail.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Sébastien Loix <sabee77@gmail.com> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Seb has this been fixed by #103629? |
Yes @cjcenizal thanks for the ping. Closing as it has been fixed in #103629 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Fixes for quality problems that affect the customer experience
Team:Kibana Management
Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more
Non blocking validation
The form lib allows consumer to declared "non blocking" validations by setting
isBlocking: false
to a validator.Let's imagine we have a field with an array of "Tags". In this case, we allow an empty array (no tags needs to be provided) but we want to have a validation when adding a tag to the array (for example: the tag cannot contain the
$
character otherwise we won't add it to the array and instead we will show the validation message to the user explaining why the tag could not be added.)The field, which is the array of tags, is still valid. Simply, no items have been added yet.
The issue
We have an issue in the form lib when validating the form with non blocking validations. Calling
form.validate()
will call all the validations, including the non blocking ones and thus will block submitting the form.I've debugged this with @machadoum and the fix might be simple and we might simply need to change the
validate()
function of theuse_field.ts
fileAs this is a very sensitive area of the form lib I want to make sure I haven't overlooked something and obviously add tests around that scenario.
This issue was found by Pablo here: #101756 (comment)
The text was updated successfully, but these errors were encountered: