Skip to content
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

Merged

Conversation

jakobe
Copy link
Collaborator

@jakobe jakobe commented Nov 28, 2024

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?

  • Yes
  • No

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

  • Make sure you have implemented tests following the guidelines in: "The good: Test".
  • Make sure you have updated the cookbook with examples and showcases (for bug fixes, enhancements & new components).

Review

  • Determine if your changes are a fix, feature or breaking-change, and add the matching label to your PR. If it is tooling, dependency updates or similar, add ignore-for-release.
  • Do a self-review.
  • Request that the changes are code-reviewed
  • Request that the changes are UX reviewed (only necessary if your PR introduces visual changes)

When the pull request has been approved it will be merged to develop by Team Kirby.

@jakobe jakobe added the feature Add this PR to the changelog as a feature label Nov 28, 2024
Fuzzy3
Fuzzy3 previously requested changes Nov 28, 2024
@@ -27,6 +27,7 @@ export enum AvatarSize {
})
export class AvatarComponent {
@Input() imageSrc: string;
@Input() imageLoading: 'eager' | 'lazy' | undefined;
Copy link
Collaborator

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'?

Copy link
Collaborator

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

Copy link
Collaborator Author

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 :)

@RasmusKjeldgaard RasmusKjeldgaard dismissed Fuzzy3’s stale review November 29, 2024 08:28

Requested change was actually a comment

@jakobe jakobe enabled auto-merge (squash) November 29, 2024 08:35
@jakobe jakobe merged commit d77d5d5 into develop Nov 29, 2024
6 of 9 checks passed
@jakobe jakobe deleted the enhancement/3726-avatar-should-support-lazy-loading-of-image branch November 29, 2024 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Add this PR to the changelog as a feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Enhancement] Avatar should support lazy loading of image
3 participants