Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ Task<Page> PopModalPlatformAsync(bool animated)
}
else
{
dialogFragment.Dismiss();
source.TrySetResult(modal);
}

Expand Down
23 changes: 23 additions & 0 deletions src/Controls/tests/DeviceTests/Elements/Modal/ModalTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,29 @@ await CreateHandlerAndAddToWindow<IWindowHandler>(rootPage,
Assert.Empty(rootPage.GetCurrentPage().Navigation.ModalStack);
}

[Fact]
public async Task DismissModalIfNotAnimated()
{
SetupBuilder();
var page = new ContentPage();

var modalPage = new ContentPage()
{
Content = new Label() { Text = "Page with no animation" }
};

var window = new Window(page);

await CreateHandlerAndAddToWindow(window, async () =>
{
await page.Navigation.PushModalAsync(modalPage, false);
await OnLoadedAsync(modalPage);
await modalPage.Navigation.PopModalAsync(false);
await OnUnloadedAsync(modalPage);

});
}

class PageTypes : IEnumerable<object[]>
{
public IEnumerator<object[]> GetEnumerator()
Expand Down