-
Notifications
You must be signed in to change notification settings - Fork 416
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
[BUG] Popup not sizing to contents when onPresenting is used. #1887
Comments
What happens if you don't assign the Messages property but just add to it? So something like: MyPopupViewmodel.cspublic class MyPopupViewmodel : INotifyPropertyChanged
{
public event PropertyChangedEventHandler? PropertyChanged;
public ObservableCollection<string> Messages { get; } = new ();
} MainPage.xaml.csprivate void OnButtonClicked(object sender, EventArgs e)
{
_popupService.ShowPopup<MyPopupViewmodel>(viewmodel => viewmodel.Messages.Add("Hello, World!"));
} How does this behave? |
@bijington |
I suspect that the isn't necessarily the use of the onPresenting parameter but more the timing of when this occurs during the rendering of the popup. This is likely to be a popup sizing issue. Just to confirm are you only seeing this issue on Windows? |
@bijington yep only on windows. It is almost definitely a timing issue - I admittedly didn't dive into the toolkit code, but playing around with it, specifically with |
When I changed CollectionView to BindableLayout or ListView, it was displayed at the intended size.
It seems that the correct size is not obtained only when using CollectionView. |
Is there an existing issue for this?
Did you read the "Reporting a bug" section on Contributing file?
Current Behavior
Issue
When displaying a popup using
IPopupService.ShowPopup
(or...Async
, doesn't matter), the popup is displayed empty (you can't see anything, but the main page becomes disabled and becomes enabled again after you click on it anywhere.For example (based on the default MAUI program template in VS 2022):
MyPopup.xaml
MyPopup.xaml.cs
MyPopupViewmodel.cs
MainPage.xaml.cs
The result is this:
Additional information
ShowPopup
without usingonPresenting
resolves the issue e.g.,MinimumWidthRequest
andMinimumHeightRequest
properties on theStackLayout
in the popup to any value larger than 1 also resolves the issue andShowPopup
can be used with setting the content inonPresenting
.Anything else?
No response
The text was updated successfully, but these errors were encountered: