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

md-input ignores min and max values #413

Closed
jdell64 opened this issue May 10, 2016 · 4 comments
Closed

md-input ignores min and max values #413

jdell64 opened this issue May 10, 2016 · 4 comments

Comments

@jdell64
Copy link
Contributor

jdell64 commented May 10, 2016

The code in question is:

  <md-input type="number" class="form-control"  min="1" align="end"  [(ngModel)]="numberOf" required></md-input>

vs:

  <input type="number" class="form-control"  min="1" align="end"  [(ngModel)]="numberOf" required>
  • Do you want to request a feature or report a bug?
    I would guess this is a bug since the html5 code works?
  • What is the current behavior?

My input is supposed to only take positive numbers (checked this in FF and Chrome):

(material is on the left, html5 is on the right):

Uploading html vs material_ff.png…

Using arrows, I cannot make the html5 number input lower than the min value (in this case 1). It also displays as red when manually lower than the min value.

  • Demo of issue

http://plnkr.co/edit/XKVHqFNNGDUDZ0S6fTHs?p=preview

  • What is the expected behavior?

To prevent negative values

  • What is the motivation / use case for changing the behavior?

Because it works in HTML 5 by default.

  • Which version of Angular and Material, and which browser and OS does this issue affect?

I am currently using the latest of Angular 2 and Material. I've tested it in Chrome and Firefox.

  • Other information

I have no idea how to fix... sorry.

@davidgabrichidze
Copy link
Contributor

@jdell64 I suppose this is known issue and already improved in PR #343 which is on its way

@jdell64
Copy link
Contributor Author

jdell64 commented May 11, 2016

Sorry, tried to find if it was reported already.

Carry on :D

On May 10, 2016, at 10:42 PM, David Gabrichidze [email protected] wrote:

@jdell64 I suppose this is known issue and already improved in PR #343 which is on its way


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

@jelbourn
Copy link
Member

Closed via #457

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants