CommunityToolkit / CommunityToolkit/Maui
[BUG] Popup does not fill screen
- 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
The popup, both v1 and v2, do not respect the `HorizontalOptions="Fill"` setting when set on either the `ContentView` or the top-level Grid of the popup view.
### Expected Behavior
When `HorizontalOptions="Fill"` is specified, the popup should fill the whole screen.
### Steps To Reproduce
1. Open the solution from the reproduction sample.
2. Click the button "Open Popup" to see the current behaviour.
3. Click the button "Open Popup with Workaround" to see the expected behaviour.
### Link to public reproduction project repository
https://github.com/mklement-ps/maui-community-toolkit-popup-bug
### Environment
```markdown
- .NET MAUI CommunityToolkit: 12.1.0 (occurred also in 11.2.0 and 12.0.0)
- OS: Windows 11 Pro 24H2
- .NET MAUI: 9.0.90 (occurred also in 9.0.80)
```
### Anything else?
Does also not work with `VerticalOptions="Fill"`.
Please not that I set the popup margin and padding to 0 on the global default:
```cs
.UseMauiCommunityToolkit(options =>
{
options.SetPopupDefaults(new DefaultPopupSettings
{
Margin = 0,
Padding = 0
});
options.SetPopupOptionsDefaults(new DefaultPopupOptionsSettings
{
Shadow = null,
Shape = new Microsoft.Maui.Controls.Shapes.RoundRectangle
{
CornerRadius = new CornerRadius(10, 10, 0, 0),
StrokeThickness = 0
}
});
})
```
Contributor guide
Assessment
This issue has not been assessed yet.