Skip to content
This repository has been archived by the owner on Jul 31, 2024. It is now read-only.

f-form-builder: The custom async validator on options doesnt set error message correctly on the first validation call #161

Closed
gammaSpeck opened this issue Oct 13, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@gammaSpeck
Copy link
Contributor

Bug description

When using a custom async validator, the validation error message is not picked up correctly on the first call. Future subsequent calls it picks it up correctly.

Reproduction steps

Use the same data as provided here #160

Screen.Recording.2023-10-13.at.7.29.53.PM.mov

Expected behaviour

The error message must also be shown on the first validation call

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context

@gammaSpeck gammaSpeck added the bug Something isn't working label Oct 13, 2023
@vikas-cldcvr
Copy link
Contributor

@gammaSpeck This issue is not re-producible, Is it possible to create sandbox? I feel it is mostly reactivity issue.

@vikas-cldcvr vikas-cldcvr self-assigned this Oct 16, 2023
@vikas-cldcvr
Copy link
Contributor

When we have a combination of an async validator and a dynamic message, we must use a callback function for the message, as shown in the following example.

{ name: "custom", validate: customDatasetValidator, message: () => datasetValidity.msg }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants