angular_components icon indicating copy to clipboard operation
angular_components copied to clipboard

Make material-input read-only

Open giorgiofran opened this issue 8 years ago • 4 comments

I could not find any way to make a material-input field readonly. Am I wrong?

giorgiofran avatar Dec 23 '16 09:12 giorgiofran

This? <material-input [disabled]="true" label="Disabled">

pcaneill avatar Dec 23 '16 11:12 pcaneill

Disabled vs. readonly

  • Values for disabled form elements are not passed to the processor method.
  • Some browsers may override or provide default styling for disabled form elements.
  • Disabled form elements do not receive focus.
  • Disabled form elements are skipped in tabbing navigation.
  • Disabled form elements do not allow copying the content

giorgiofran avatar Dec 23 '16 13:12 giorgiofran

I also would need a readOnly property. using disabled seems to be broken #165. And I can't come up with any other solution except duplicating every single material-input.

sturmf avatar Oct 03 '17 07:10 sturmf

Material Inputs were updated to be read only in e876793f8ffbf849bbf2b126d9798306d74570f0. Try them on the a newer release ^0.9.0-alpha+10. Does that cover your use case?

nshahan avatar Apr 10 '18 23:04 nshahan