Specify lazy loading for avatars (#10866)
* Specify lazy loading for avatars so browser doesn't fetch eagerly if off-screen * Update snapshots
This commit is contained in:
committed by
GitHub
parent
73007d6dd6
commit
2cee8a4b01
@@ -135,6 +135,7 @@ const BaseAvatar: React.FC<IProps> = (props) => {
|
||||
);
|
||||
const imgNode = (
|
||||
<img
|
||||
loading="lazy"
|
||||
className="mx_BaseAvatar_image"
|
||||
src={AvatarLogic.defaultAvatarUrlForString(idName || name)}
|
||||
alt=""
|
||||
@@ -201,6 +202,7 @@ const BaseAvatar: React.FC<IProps> = (props) => {
|
||||
} else {
|
||||
return (
|
||||
<img
|
||||
loading="lazy"
|
||||
className={classNames("mx_BaseAvatar mx_BaseAvatar_image", className)}
|
||||
src={imageUrl}
|
||||
onError={onError}
|
||||
|
||||
Reference in New Issue
Block a user