Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

input: md-maxlength validation doesn't happen on initialization for interpolated size #11329

Closed
brianrodecap opened this issue Jun 18, 2018 · 0 comments · Fixed by #11338
Closed
Assignees
Labels
has: Pull Request A PR has been created to address this issue P3: important Important issues that really should be fixed when possible. resolution: fixed type: bug
Milestone

Comments

@brianrodecap
Copy link

Bug, enhancement request, or proposal:

Using md-maxlength="MAX" on an input field that initializes to some value of length > "MAX", the md-maxlength validation does not happen, and the input field is considered valid.

See original issue #10320

CodePen and steps to reproduce the issue:

https://codepen.io/Splaktar/pen/vdmNPJ?editors=1010#0

Detailed Reproduction Steps:

  1. You should be able to see that the field using the interpolated md-maxlength is incorrectly initially valid and the others are correctly marked invalid.

What is the expected behavior?

I would expect that all fields be initially invalid.

Which versions of AngularJS, Material, OS, and browsers are affected?

  • AngularJS: 1.6.7
  • AngularJS Material: 1.1.9
  • OS: MacOS, Windows
  • Browsers: Chrome
@Splaktar Splaktar added type: bug for: external contributor P4: minor Minor issues. May not be fixed without community contributions. needs: unit tests This PR needs unit tests to cover the changes being proposed labels Jun 18, 2018
@Splaktar Splaktar added this to the 1.1.11 milestone Jun 18, 2018
@Splaktar Splaktar added P3: important Important issues that really should be fixed when possible. needs: Pull Request and removed P4: minor Minor issues. May not be fixed without community contributions. labels Jun 18, 2018
feloy added a commit to feloy/material that referenced this issue Jun 24, 2018
@Splaktar Splaktar added has: Pull Request A PR has been created to address this issue and removed needs: Pull Request needs: unit tests This PR needs unit tests to cover the changes being proposed labels Jul 2, 2018
@Splaktar Splaktar self-assigned this Jul 2, 2018
mmalerba pushed a commit that referenced this issue Jul 9, 2018
…h interpolated value (#11338)

Closes #11329


## PR Checklist
Please check that your PR fulfills the following requirements:
- [x] The commit message follows [our guidelines](https://github.com/angular/material/blob/master/.github/CONTRIBUTING.md#-commit-message-format)
- [x] Tests for the changes have been added or this is not a bug fix / enhancement
- [x] Docs have been added, updated, or were not required

## PR Type
What kind of change does this PR introduce?
```
[x] Bugfix
[ ] Enhancement
[ ] Documentation content changes
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Infrastructure changes
[ ] Other... Please describe:
```

## What is the current behavior?

Using md-maxlength="MAX" on an input field that initializes to some value of length > "MAX", the md-maxlength validation does not happen, and the input field is considered valid.

Issue Number: #11329 

## What is the new behavior?

The validation now happens with specified value and error is detected

## Does this PR introduce a breaking change?
```
[ ] Yes
[x] No
```
<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. -->
<!-- Note that breaking changes are highly unlikely to get merged to master unless the validation is clear and the use case is critical. -->

## Other information
Splaktar pushed a commit that referenced this issue Jul 31, 2018
…h interpolated value (#11338)

Closes #11329


## PR Checklist
Please check that your PR fulfills the following requirements:
- [x] The commit message follows [our guidelines](https://github.com/angular/material/blob/master/.github/CONTRIBUTING.md#-commit-message-format)
- [x] Tests for the changes have been added or this is not a bug fix / enhancement
- [x] Docs have been added, updated, or were not required

## PR Type
What kind of change does this PR introduce?
```
[x] Bugfix
[ ] Enhancement
[ ] Documentation content changes
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Infrastructure changes
[ ] Other... Please describe:
```

## What is the current behavior?

Using md-maxlength="MAX" on an input field that initializes to some value of length > "MAX", the md-maxlength validation does not happen, and the input field is considered valid.

Issue Number: #11329 

## What is the new behavior?

The validation now happens with specified value and error is detected

## Does this PR introduce a breaking change?
```
[ ] Yes
[x] No
```
<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. -->
<!-- Note that breaking changes are highly unlikely to get merged to master unless the validation is clear and the use case is critical. -->

## Other information
Splaktar pushed a commit that referenced this issue Aug 2, 2018
…h interpolated value (#11338)

Closes #11329


## PR Checklist
Please check that your PR fulfills the following requirements:
- [x] The commit message follows [our guidelines](https://github.com/angular/material/blob/master/.github/CONTRIBUTING.md#-commit-message-format)
- [x] Tests for the changes have been added or this is not a bug fix / enhancement
- [x] Docs have been added, updated, or were not required

## PR Type
What kind of change does this PR introduce?
```
[x] Bugfix
[ ] Enhancement
[ ] Documentation content changes
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Infrastructure changes
[ ] Other... Please describe:
```

## What is the current behavior?

Using md-maxlength="MAX" on an input field that initializes to some value of length > "MAX", the md-maxlength validation does not happen, and the input field is considered valid.

Issue Number: #11329 

## What is the new behavior?

The validation now happens with specified value and error is detected

## Does this PR introduce a breaking change?
```
[ ] Yes
[x] No
```
<!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. -->
<!-- Note that breaking changes are highly unlikely to get merged to master unless the validation is clear and the use case is critical. -->

## Other information
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
has: Pull Request A PR has been created to address this issue P3: important Important issues that really should be fixed when possible. resolution: fixed type: bug
Projects
None yet
2 participants