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

mdMaxlength: Always invalid for input type="number" #5321

Closed
aaronPMorabito opened this issue Oct 22, 2015 · 9 comments
Closed

mdMaxlength: Always invalid for input type="number" #5321

aaronPMorabito opened this issue Oct 22, 2015 · 9 comments
Labels
P4: minor Minor issues. May not be fixed without community contributions. type: bug

Comments

@aaronPMorabito
Copy link

An input flagged with type="number" and md-maxlength="#" will always have a validation error.

Can be seen in this example under 'Errors': https://material.angularjs.org/latest/demo/input

Material Design v 1.0.0-rc1

@topherfangio
Copy link
Contributor

For clarification, the hourly rate input in the linked demo will always be invalid.

@topherfangio
Copy link
Contributor

@aaronPMorabito We are talking about whether or not md-maxlength is meaningful on a number input. Can you provide some feedback as to how you are using this?

We are planning to update the demo to not use md-maxlength on the Hourly Rate input to cause less confusion.

topherfangio added a commit that referenced this issue Dec 14, 2015
Due to a CSS property that was not restrictive enough, standard
error messages were hidden by default.

Restrict CSS to components with the `md-auto-hide` class.

Also, remove the `md-maxlength` requirement from the errors demo
to reduce confusion.

Fixes #5837. References #5321.
topherfangio added a commit that referenced this issue Dec 14, 2015
Due to a CSS property that was not restrictive enough, standard
error messages were hidden by default.

Restrict CSS to components with the `md-auto-hide` class.

Also, remove the `md-maxlength` requirement from the errors demo
to reduce confusion.

Fixes #5837. References #5321.

Closes #6298
@EladBezalel
Copy link
Member

@topherfangio is this fixed?

@ThomasBurleson ThomasBurleson added P1: urgent Urgent issues that should be addressed in the next minor or patch release. and removed priority: high labels Jan 13, 2016
@ThomasBurleson ThomasBurleson modified the milestone: Backlog Jan 14, 2016
@topherfangio
Copy link
Contributor

@EladBezalel This is partially fixed, we have removed the md-maxlength attribute from the demo so as not to cause confusion, but we still need to talk about whether or not it makes any sense for number inputs.

Was hoping to get some more feedback from @aaronPMorabito on how it might be used to see if we want to support it.

I say we close it for now and we can reopen if we get more feedback unless @ThomasBurleson gave it a P1 for a different reason.

@ThomasBurleson ThomasBurleson added P4: minor Minor issues. May not be fixed without community contributions. and removed P1: urgent Urgent issues that should be addressed in the next minor or patch release. labels Jan 18, 2016
@aaronPMorabito
Copy link
Author

@topherfangio I was only using it since it was in the demo and I thought it was fancy. I noticed that it was always causing validation errors when used in combination with type="number" so I reported it. I was using it to display the length of the string input and the max possible length of that string.

devversion added a commit to devversion/material that referenced this issue Feb 13, 2016
devversion added a commit to devversion/material that referenced this issue Feb 13, 2016
devversion added a commit to devversion/material that referenced this issue Feb 13, 2016
devversion added a commit to devversion/material that referenced this issue Feb 13, 2016
devversion added a commit to devversion/material that referenced this issue Mar 21, 2016
gmoothart pushed a commit to gmoothart/material that referenced this issue Apr 5, 2016
@bitbytebot
Copy link

We are talking about whether or not md-maxlength is meaningful on a number input.

Why would you exclude such a function specifically for <input type="number">??? It does make sense and I actually need it in my projects.

You force me and many others to use <input type="tel"> because of your exclusion.

@topherfangio
Copy link
Contributor

@bitbytebot We haven't specifically excluded this, it's just that based on the feedback above, we didn't see it as a high priority bug since we didn't see a good use-case.

If you have a valid use-case, please do share and we can discuss reopening it.

Also, is <input type="tel" /> a good workaround, or does it cause problems?

Thanks!

@bitbytebot
Copy link

@topherfangio I have a use for it, but now I'm using <input type="tel" /> because it works similar to what I need.

I built a configurator for vehicle registration plates which have a maximum amount of number combinations (3). So this is a needed component, for me at least. I can think of multiple use-cases for this:

  • zip code
  • flight number
  • vehicle identification number
  • bank account number (IBAN in the SEPA-zone)

I could think of couple more. But there is definitely a use for it.

@Gaurav9969351313
Copy link

not working mdinput in IE10
type=number side arrow event

<input mdInput type="number" onkeypress="return event.code !='NumpadDecimal' && event.code!='Period'" [step]="10" [max]="100" [min]="0">

in chrome m getting the desired output as we press up down arrows it inputfield text jumps to 10 ( as step is=10 )

but same is not working in IE10 and IE11. kindly suggest the resolve the same.

do i need to update my polyfills...
if yes then please suggest for the same....
Thank You in Advance...:)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
P4: minor Minor issues. May not be fixed without community contributions. type: bug
Projects
None yet
Development

No branches or pull requests

7 participants