Skip to content

Bug - Input - Validation - First time validation doesn't show error #7558

@sofarojo

Description

@sofarojo

Bug, feature request, or proposal:

BUG - First time validation doesn't show error until you tab out.

Example:
An input that only admits one digit (pattern[0-9])

First time:
you write "Hello" and there is no error shown until you tab out.

Second time:
you erase "hello" and write "9" then the error disappear immediately

Third time:
you erase "9" and write again "hello" then the error appears immediately with no need of tabbing out.

What is the expected behavior?

Field show error from the first time you write an incorrect value. There is no need of tabbing out once.

What is the current behavior?

Field show error only after having tabbing out one time.

What are the steps to reproduce?

https://stackblitz.com/edit/material2-input-first-time-validation

What is the use-case or motivation for changing an existing behavior?

Inform the user immediately of an wrong field value with no distinction if you tab out once or not.

Which versions of Angular, Material, OS, TypeScript, browsers are affected?

Angular: ~4.4.3
Material: 2.0.0-beta.11
OS: Win10
TypeScript: ~2.4.0
Browsers: All browsers

Is there anything else we should know?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions