question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

md-input (type=number) possible bug: Restore Placeholder on empty value

See original GitHub issue

Bug, feature request, or proposal:

Bug (maybe)

What is the expected behavior?

If I user an md-input with type number and delete the input value, the placeholder should go back to it’s initial place (= Inside Input box) , like placeholder get’s restored in a plain html input box.

What is the current behavior?

Upon erasing the field, console prints

"The specified value "NaN" is not a valid number. The value must match to the following regular expression: -?(\d+|\d+\.\d+|\.\d+)([eE][-+]?\d+)?"

The field is empty, but the placeholder remains ontop of the box.

What are the steps to reproduce?

See Plunker

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

Current Angular rc5 / Material alpha.7

Is there anything else we should know?

Yes, I like your work 😃 Thank you very much.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:5
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mmalerbacommented, Dec 14, 2016

fixed for md-input-container which will replace md-input

0reactions
angular-automatic-lock-bot[bot]commented, Sep 8, 2019

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

md-input (type=number) possible bug: Restore Placeholder ...
The problem seems to be an "" (empty string) when a contained value is deleted. This also affects form validation as a required...
Read more >
Input number in Angular Material Design? - Stack Overflow
In short, yes. You want < md-input-container > wrapper which supports the following input types. date; datetime-local; email; month; number ...
Read more >
Input label does not move up when value or placeholder is sp
I am trying to use mdbootstrap in my meteor app but am running into issues with forms: the label does not move above...
Read more >
:placeholder-shown - CSS: Cascading Style Sheets | MDN
The :placeholder-shown CSS pseudo-class represents any or element that is currently displaying placeholder text.
Read more >
Input & Textarea - Vue Material - Creative Tim
Text fields allow users to input, edit and select text typically inside forms. But they can appear in other places as well like...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found