-
Notifications
You must be signed in to change notification settings - Fork 23
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
Avatar: support lazy loading of image #3727
Avatar: support lazy loading of image #3727
Conversation
@@ -27,6 +27,7 @@ export enum AvatarSize { | |||
}) | |||
export class AvatarComponent { | |||
@Input() imageSrc: string; | |||
@Input() imageLoading: 'eager' | 'lazy' | undefined; |
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.
Any reason for having 'undefined' as type since undefined results in the default value which is 'eager'?
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 potentially just have 'eager' as default 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.
The reason is we don't set the html attribute if the input property is not set. That will then default to the browser's default (which is eager
), but IMO we shouldn't "own" that fallback, the browser should :)
Requested change was actually a comment
…zy-loading-of-image
Which issue does this PR close?
This PR closes #3726
What is the new behavior?
Adds support for lazy loading of the image in image avatars.
Does this PR introduce a breaking change?
Are there any additional context?
Checklist:
The following tasks should be carried out in sequence in order to follow the process of contributing correctly.
Reminders
Review
When the pull request has been approved it will be merged to
develop
by Team Kirby.