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

@HostBinding attributes are not respected by MatFormField #14024

Closed
klemenoslaj opened this issue Nov 7, 2018 · 2 comments
Closed

@HostBinding attributes are not respected by MatFormField #14024

klemenoslaj opened this issue Nov 7, 2018 · 2 comments
Labels
area: material/form-field P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent

Comments

@klemenoslaj
Copy link
Contributor

klemenoslaj commented Nov 7, 2018

Bug, feature request, or proposal:

Bug

What is the expected behavior?

Adding a readonly attribute via HostBinding to matInput host element should put input element to the read-only state, the same way as readonly="true" does when directly added to an element.

What is the current behavior?

HTML5 input element is correctly in readonly state, however, matFormField is still triggering focus animation

What are the steps to reproduce?

https://stackblitz.com/edit/angular-ty6kkd

First input field is what I expect second field should work like as well.
The difference is on the first field I use readonly="true", while on the second I use @HostBinding() readonly = true.

What is the use-case or motivation for changing an existing behavior?

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

Angular: ^7
Material: ^7
TypeScript: ^3

@vivian-hu-zz vivian-hu-zz added the P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent label Nov 8, 2018
@aitboudad
Copy link
Contributor

not only readonly but also placeholder and id attrs, hoping this will be considered!

@crisbeto
Copy link
Member

Closing since host bindings set values directly on the DOM node, they don't set inputs so there isn't a way for Material to respond to those changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: material/form-field P3 An issue that is relevant to core functions, but does not impede progress. Important, but not urgent
Projects
None yet
Development

No branches or pull requests

6 participants