-
Notifications
You must be signed in to change notification settings - Fork 6.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
Patch fixes for latest sync #20401
Patch fixes for latest sync #20401
Conversation
Can you amend your commits to include more information about why the change is being made? |
* These checks caused failures in pantheon where icons were not loading
9fa0c28
to
08c33c6
Compare
@jelbourn Updated my commit messages. Let me know if those are descriptive enough |
@@ -507,7 +507,7 @@ export class MatFormField extends _MatFormFieldMixinBase | |||
if (this._control) { | |||
let ids: string[] = []; | |||
|
|||
if (this._control.userAriaDescribedBy) { | |||
if (typeof this._control.userAriaDescribedBy === 'string') { |
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.
Can you add a comment on why this assertion is needed? It's not clear to me in what cases userAriaDescribedBy
becomes an object.
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.
I'm not sure why it happens but I am sure that it does happen. I just noticed that this was happening to an internal project and causing failures so I tried adding a check to see if .split was defined before calling it
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.
My hypothesis would be that the lack of template type checking somewhere is letting someone bind an invalid value into something that then makes its way into aria-describedby
. What we would typically want to do here is get to the root cause of the issue and potentially fix the offending app rather than accommodating an invalid value since the type system is supposed to provide this kind of protection.
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.
Yeah, that seems more likely to me. That's where I was heading. It seems wrong to change form-field in favor of something we don't fully understand yet.
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.
Unless we can find the root cause of this type error, is the only other alternative to revert the entire PR?
Here's the PR that added this change
#19587
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.
Who can look into this? I don't think I have the ability to help with that, unfortunately. To me it also sounds like someone explicitly passes an object to aria-describedby
using an Angular input binding. It should be possible to filter out this app from the stack trace where the form-field threw an error. How many instances of these errors did you see?
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.
Just one. I'm also on vacation rn but I can track it down in my spare time. I'm not sure how long it'll take, though. Would we be ok with leaving this patch fix for now and adding a todo saying once this is tracked down we should remove this check?
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.
Yeah, for sure. Works for me. I'll leave that to you. just wanted to make sure that this is temporary/fixed up in the future.
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.
I'll take the responsibility for this. You guys can call me out for it if this isn't resolved or at least updated within the next 2 weeks. I also created an issue to make sure we don't lose track of this #20403
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.
More information: it's the Google Fonts app where this fails, and nowhere in the app do they set an aria-describedby
, so it seems like it's something that's coming from us.
08c33c6
to
35b3b73
Compare
35b3b73
to
147689a
Compare
* Internal test was failing because userAriaDescribedBy showed up as an object so calling .split was throwing errors.
147689a
to
5552abe
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
I pushed a change to one of your commits to remove a leftover console.log
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. |
Revert the latest change to
src/material/icon/icon-registry.ts
andsrc/material/icon/icon.ts
(See PR #20146).Add a type to
src/material/form-field/form-field.ts
to ensureuserAriaDescribedBy
is a string before calling .split.These changes resolved internal failures where 1. icons stopped showing up and were caught by a screenshot test, and 2. calling .split was causing an error and it was discovered that
userAriaDescribedBy
was an object.