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

[BigDecimalField] Implement the new validation behavior #4233

Closed
vursen opened this issue Nov 28, 2022 · 1 comment · Fixed by #4345
Closed

[BigDecimalField] Implement the new validation behavior #4233

vursen opened this issue Nov 28, 2022 · 1 comment · Fixed by #4345
Assignees

Comments

@vursen
Copy link
Contributor

vursen commented Nov 28, 2022

An overview of the changes to be done

  • Prevent the web component from setting itself to valid using ClientValidationUtil.
  • Trigger constraint validation on client validated event
 (requires the HasClientValidation interface).
  • Trigger binder validation on client validated event (requires the HasValidator interface).
  • Synchronize the _hasInputValue property.
  • Check for bad input (non-numeric input) during constraint validation based on the _hasInputValue property.

See DatePicker and TextField for an example.

Constraints to be tested

  • required
  • bad input

Additional context

There are abstract classes AbstractValidationIT and AbstractValidationPage which are supposed to be extended when testing validation for a specific component.

Part of vaadin/platform#3066

@vursen
Copy link
Contributor Author

vursen commented Nov 28, 2022

The big decimal field's web component is currently maintained directly in the flow-components repo. It is based on TextField + allowedCharPattern + inputmode=decimal. However, I don't think it will be a problem. The proposed approach should work for it too.

required and bad input seem to be the only validation constraints we need to take care of.

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

Successfully merging a pull request may close this issue.

1 participant