Skip to content

[BUG] AvatarView changes size when setting its ImageSource #3153

@Jean-RobertLaffineur

Description

@Jean-RobertLaffineur

Is there an existing issue for this?

  • I have searched the existing issues

Did you read the "Reporting a bug" section on Contributing file?

Current Behavior

The AvatarView that has its ImageSource property initially null unexpectedly changes size when updating its ImageSource property.

Image Image

Expected Behavior

The AvatarView should keep its 32x32 size.

Steps To Reproduce

  1. Open and run the solution from the reproduction repository
  2. Observe the AvatarView respecting the 32x32 size, being entirely displayed within its circular border.
  3. Press the button
  4. Observe the Avatar displaying the image (which replaces the text) and growing to exceed the 32x32 size, the circle and part of the image being cropped.
  5. Press the button once more
  6. Observe the AvatarView being resized to its original, correct size.

Link to public reproduction project repository

https://github.com/Jean-RobertLaffineur/AvatarViewSizingIssue

Environment

- .NET MAUI CommunityToolkit: 14.0.1
- OS: Windows 11 Enterprise (25H2)
- .NET MAUI: 10.0.50

Anything else?

Workaround

Manually changing the WidthRequest or HeightRequest to a different value (such as WidthRequest - 1) forces the resize and allows working around the cropped image issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions