-
Notifications
You must be signed in to change notification settings - Fork 6.8k
fix(checkbox): unknown property warning with Ivy during server-side rendering #17485
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
fix(checkbox): unknown property warning with Ivy during server-side rendering #17485
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM in general. Do we actually want to work around this, if it is just a warning?
I'm good working around this (just asking if doing nothing is also an option), but it might be good to submit an issue on the domino repo?
IMO we should work around it, because people using our components can't do anything about it if they're rendering on the server. |
Yeah that is true. I guess a todo would be good with a link to an issue on the domino repo. That way, we can remove the workaround if it gets resolved. |
Yeah I would say file an issue over at https://github.com/fgnass/domino and leave a TODO to clean it up if they fix it |
* Syncs the indeterminate value with the checkbox DOM node. | ||
* | ||
* We sync `indeterminate` directly on the DOM node, because in Ivy the check for whether a | ||
* property is supported on an element boils down to `if (propName in element)`. Domino's |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we file an issue (or send a PR) for Domino and add a TODO here referencing that?
(not sure if there's more to it than adding to the input attrs object)
8c04176
to
8c75a17
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
6a15e89
to
1587c8d
Compare
@crisbeto It looks like there's ~4 apps that have checkboxes that now appear indeterminate when they were previously unchecked. Could you split this into 2 PRs, one that fixes the SSR issue and one the fixes the coercion? That should make it easier to get the critical part in. |
I don't think there's a way to split it up. We need to change the way we assign the |
Ok, will need to figure out what's going on with those tests before we can merge |
Needs rebase |
…endering Ivy's check for whether a property supported is basically `if (propName in element)` which logs a warning if it doesn't match. It seems like Domino hasn't implemented the `indeterminate` property for `input` so Angular ends up logging a warning during server-side rendering. These changes switch to setting the property directly to avoid using a property binding. Also fixes that the current Material checkbox wasn't coercing the `indeterminate` input to a boolean.
Rebased. |
1587c8d
to
c791375
Compare
This caused two apps to break since we are now coercing the values. They both had something like |
Creating fixes for those apps now, and will merge once that is finished |
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. |
Ivy's check for whether a property supported is basically
if (propName in element)
which logs a warning if it doesn't match. It seems like Domino hasn't implemented theindeterminate
property forinput
so Angular ends up logging a warning during server-side rendering. These changes switch to setting the property directly to avoid using a property binding.Also fixes that the current Material checkbox wasn't coercing the
indeterminate
input to a boolean.