Skip to content

Bug: input placeholder is not displayed on field reset after editing #2489

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

Closed
Parez opened this issue Jan 1, 2017 · 4 comments
Closed

Bug: input placeholder is not displayed on field reset after editing #2489

Parez opened this issue Jan 1, 2017 · 4 comments
Assignees

Comments

@Parez
Copy link

Parez commented Jan 1, 2017

Bug: if the input field is cleared with reset after being changed, the placeholder is not displayed. Feels like it should if the field is empty and marked as untouched.

Following steps to reproduce:

Using reactive forms.

  1. Create an input field (md-input) with placeholder set to some text inside md-input-container .
  2. On some event (e.g.) checkbox selected - reset the input.
  3. Now two cases:
    1. If placeholder is floatingPlaceholder it stays above (though should go down if field is reset)
    2. If placeholder is not floatingPlaceholder it is not displayed at all (though it should be)

I was making a form where the input should get cleared and disabled once checkbox is selected. And default value (e.g. placeholder) should be displayed instead of the text in the input. Spent all day trying to figure out how it can be solved. Didn't find a way.

"@angular/material": "^2.0.0-beta.1", Chrome

The other thing which also feels as quite weird behaviour:
When input is programmatically disabled via reactive forms, the border is not becoming dotted. The same setup as above.
screen shot 2017-01-01 at 22 16 23

@devversion devversion self-assigned this Jan 1, 2017
@devversion
Copy link
Member

Please provide a Plunker for your issue.

Template: http://plnkr.co/edit/o077B6uEiiIgkC0S06dd?p=preview

@Parez
Copy link
Author

Parez commented Jan 1, 2017

@devversion
Copy link
Member

Thanks for the Plunker! I just confirmed that your issue will be solved with #2455.

Here is an updated Plunker using the fix: http://plnkr.co/edit/Rls3SCRQ94J6bLtCXaPt?p=preview

I will close that issue since we already have related ones #2477, #2363, #2441

@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 5, 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

No branches or pull requests

2 participants