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

refactor!: ensure initial validation with constraints and value #4406

Conversation

vursen
Copy link
Contributor

@vursen vursen commented Aug 29, 2022

Description

This PR ensures initial validation for email-field when it has constraints and value. Unlike other components, in the case of email-field, it means that the initial validation will always happen initially when it has value since there is a default pattern constraint.

In case the user wants to control invalid manually, the default pattern can be disabled by providing a custom empty pattern:

<vaadin-email-field value="user@example.com" pattern="" invalid></vaadin-email-field>

Warning
It is a kind of breaking change because manual invalid control is no longer possible when the field has a value unless the user disables the default pattern explicitly.

Extracted from #4386

Part of #4371

Type of change

  • Refactor

Checklist

  • I have read the contribution guide: https://vaadin.com/docs-beta/latest/guide/contributing/overview/
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.

@sonarcloud
Copy link

sonarcloud bot commented Aug 29, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@vursen vursen changed the title refactor!(email-field): ensure initial validation when the field has constraints and value refactor!(email-field): ensure initial validation with constraints and value Aug 29, 2022
@web-padawan web-padawan changed the title refactor!(email-field): ensure initial validation with constraints and value refactor!: ensure initial validation with constraints and value Aug 29, 2022
@web-padawan web-padawan merged commit f4b11b8 into master Aug 29, 2022
@web-padawan web-padawan deleted the refactor/email-field/ensure-initial-validation-with-costraints branch August 29, 2022 13:43
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 23.2.0.rc1 and is also targeting the upcoming stable 23.2.0 version.

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

Successfully merging this pull request may close these issues.

3 participants