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

fix: adds constraint validation to all form-associated elements #3932

Merged
merged 8 commits into from Sep 22, 2020

Conversation

nicholasrice
Copy link
Contributor

@nicholasrice nicholasrice commented Sep 18, 2020

Description

This change adds a mechanism to FormAssociated to set field validity after constraint property changes, including value and required. By default, this new validate() method sets validity to the validity of the proxy element, using the validationMessage of the proxy. This behavior can be overridden or extended for an implementing element.

closes #3761

Motivation & context

Issue type checklist

  • Chore: A change that does not impact distributed packages.
  • Bug fix: A change that fixes an issue, link to the issue above.
  • New feature: A change that adds functionality.

Is this a breaking change?

  • This change causes current functionality to break.

Adding or modifying component(s) in @microsoft/fast-components checklist

Process & policy checklist

  • I have added tests for my changes.
  • I have tested my changes.
  • I have updated the project documentation to reflect my changes.
  • I have read the CONTRIBUTING documentation and followed the standards for this project.

@nicholasrice nicholasrice added this to the Release 12 milestone Sep 21, 2020
@nicholasrice nicholasrice self-assigned this Sep 21, 2020
describe("with constraint validation", () => {
Object.keys(TextFieldType)
.map(key => TextFieldType[key])
.forEach(type => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NICE!

@nicholasrice nicholasrice merged commit 60fbec0 into master Sep 22, 2020
@nicholasrice nicholasrice deleted the users/nirice/add-constraint-validation branch September 22, 2020 05:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fast-text-field does not correctly report elements validity (chrome)
3 participants