CommunityToolkit / CommunityToolkit/Maui

[BUG] Snackbar vertical size and top location are different on iOS and Android

Open
#2,645 2 comments 0 reactions 0 assignees View on GitHub
bug unverified
Dominant language
C#
Stars
2.7k
Forks
500
Avg merge
2d 14h
Merged PRs (30d)
7

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

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

- [x] I have read the "Reporting a bug" section on Contributing file: https://github.com/CommunityToolkit/Maui/blob/main/CONTRIBUTING.md#reporting-a-bug

### Current Behavior

Previously, snackbar was fixed to equalize the horizontal dimensions on iOS and Android in here: #1901

When the snackbar hosts content (message) that spans about half the vertical space of the screen, I observe inconsistencies in its vertical size and its top-start positioning. The snackbar does not maintain a consistent layout compared to when it hosts smaller content. Additionally, the behavior appears to vary depending on the version of the CommunityToolkit in use. Specific version details are included in the attached screenshots.

The images indicate if the snackbar IS or IS NOT EXPLICETELY anchored to the label in the left lover corner (red label). The snackbar does render differently (top-start position) based on whether it is explicitly anchored to a view.

### Expected Behavior

The snackbar should maintain a consistent vertical size and start position, regardless of the content size or the version of the CommunityToolkit. The preferred behavior is to display as much of the vertical content as the vertical space of the screen allows instead of arbitrary truncating the height of the snackbar.

![Image](https://github.com/user-attachments/assets/9f3436af-c764-4c73-84b0-9b836dd141ab)
![Image](https://github.com/user-attachments/assets/d9192777-72dd-491d-b5e3-509dcfd2d264)
![Image](https://github.com/user-attachments/assets/b13eca51-9c4b-4a1f-8a1d-37cded34f713)
![Image](https://github.com/user-attachments/assets/c104c248-312a-40c1-9cfb-7b7bf17cf9a4)
![Image](https://github.com/user-attachments/assets/614e9803-b0e1-478b-821f-ed9353da4d39)
![Image](https://github.com/user-attachments/assets/35294681-7152-49e5-bd4a-7d2a0d9e10c7)
![Image](https://github.com/user-attachments/assets/9311e529-7805-4b37-b900-37d19c0db85e)
![Image](https://github.com/user-attachments/assets/cd22911d-a120-4049-9b84-cf865eb9aafc)

### Steps To Reproduce

The images indicate if the snackbar was or was not explicitly anchored to the label in the left lover corner (red label)
1) Open and run project referenced here
2) Target different platforms - iOS and Android while changing:
a) size of the snackbar message in code
b) CommunityToolkit version

### Link to public reproduction project repository

https://github.com/MichaelShapiro/MauiBugs/tree/master/SnackbarBug

### Environment

```markdown
- .NET MAUI CommunityToolkit: 9.0.1, 11.0.0, 11.1.1, 11.2.0,
- OS: iOS, Android
- .NET MAUI: 9.0.60
```

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.