-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Angular matInput renders incorrectly in forms. Seems to be broken? #37187
Comments
Hi @grantcurell, Thanks for providing a repro. I looked at the Stackblitz page and noticed JS error being throw by Forms module:
This error prevents form controls from initial rendering. It looks like the Since there are no action items for framework, I'm going to close this ticket. Feel free to reopen if the problem still exists. Thank you. |
@AndrewKushnir man I can't thank you enough. I saw that error, but because I knew the data was present I went down the wrong path of trying to understand the behavior instead of just clearing the error. I was like - well, all of it is there, I just have to click around to get it to show up. I should have cleared the error first. This is pure curiosity on my part - why would clicking around cause the rest to render? Edit: Also sorry I wasted your time with a swing and miss thinking something was wrong outside my own ineptitude 😂 |
@grantcurell, no problem, glad to know that the solution worked.
I didn't dig deeper to identify why clicking on inputs caused styles and content to appear, but my guess is that clicking caused a new change detection cycle for these components, thus applying updates to these components. |
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 report
Affected Package
ReactiveFormsModule
Description
See this StackOverflow post.
Edit: Another person found the same problem here and here
Edit: Seems to be related to: angular/components#15274 and #16670
The guy in the attached post is having exactly the same problem I'm having. None of the components render until you click around on the form. If you click everything they render, but not before clicking each element individually.
Removing matInput from my code fixes the problem, but this breaks everything reliant on it.
Before Clicking
After Clicking
Duplication of Problem
See: https://stackblitz.com/edit/dynamic-form-ngfor?file=src%2Fapp%2Fapp.component.html
🌍 Your Environment
Angular Version:
Anything else relevant?
Tested in Firefox and Chrome
The text was updated successfully, but these errors were encountered: