-
Notifications
You must be signed in to change notification settings - Fork 6.8k
md-input-container invalid state #4671
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
Comments
Error state is calculated as
and touched is There's an open issue at #4232 that could be of interest. |
ok, but where does isSubmitted come from? My control does not change to submitted when i submit the form |
See the source here |
@willshowell yes, but there is no submitted property on my form, also in my usecase i cannot use a submit button to submit my form. |
Hmm I see. I think for your original question, your best bet is to push the team on #4232 since that would allow you to configure how the errors are shown. As a workaround for now, you could bind to the focus event and use |
ok found a workarround. I created a hidden submit button and an event listener for my custom form submitted event: ´´´ @ViewChild('submitBtn') submitBtn: ElementRef; |
Tracked via #4232 |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Bug, feature request, or proposal:
question, bug, or feature request. not sure
What is the expected behavior?
When a user enters text into a required input field and removes the text, there should be an immediate warning as the form control is now touched.
What is the current behavior?
The invalid color and md-error text are only updated after blur.
What are the steps to reproduce?
What is the use-case or motivation for changing an existing behavior?
better user experience
Which versions of Angular, Material, OS, TypeScript, browsers are affected?
ng4.1.x, md beta 5
Is there anything else we should know?
The text was updated successfully, but these errors were encountered: