-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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(icon): handle values with unnecessary spaces being passed into fontIcon and fontSet #9056
Conversation
…ntIcon and fontSet Handles values with trailing/leading spaces, as well as space-separated values being passed into the `fontIcon` and `fontSet` properties, rather than letting the browser throw a DOM exception. Fixes angular#9054.
* have to trim the value and omit space-separated values. | ||
*/ | ||
private _cleanupFontValue(value: string) { | ||
return typeof value === 'string' ? value.trim().split(' ')[0] : value; |
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.
Looks like ligatures can include whitespace:
https://twitter.com/larrythefox/status/422813021807714304
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.
Our current logic still doesn't hold up though. We used to take the value verbatim and set it as a class which is invalid. I switched it up to only take it up to the first space.
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.
Oh, right. I mixed up class and ligature
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
…ntIcon and fontSet (angular#9056) Handles values with trailing/leading spaces, as well as space-separated values being passed into the `fontIcon` and `fontSet` properties, rather than letting the browser throw a DOM exception. Fixes angular#9054.
…ntIcon and fontSet (angular#9056) Handles values with trailing/leading spaces, as well as space-separated values being passed into the `fontIcon` and `fontSet` properties, rather than letting the browser throw a DOM exception. Fixes angular#9054.
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. |
Handles values with trailing/leading spaces, as well as space-separated values being passed into the
fontIcon
andfontSet
properties, rather than letting the browser throw a DOM exception.Fixes #9054.