Skip to content

Commit

Permalink
- fix
Browse files Browse the repository at this point in the history
  • Loading branch information
PureWeen committed Aug 28, 2024
1 parent 4f9838d commit 1693c59
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 23 deletions.
52 changes: 30 additions & 22 deletions src/Controls/tests/TestCases.HostApp/Issues/Issue24434.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,44 @@ namespace Maui.Controls.Sample.Issues
{
[Issue(IssueTracker.Github, 24434, "Modifying a layout while view isn't part of the Window fails to update the layout visually",
PlatformAffected.iOS)]
public class Issue24434 : ContentPage
public class Issue24434 : NavigationPage
{
public Issue24434()
public Issue24434() : base(new TestPage())
{
VerticalStackLayout vsl = new VerticalStackLayout();

vsl.Add(new Button()
}

public class TestPage : ContentPage
{
public TestPage()
{
Text = "Click me and you should see a label appear beneath me",
LineBreakMode = LineBreakMode.WordWrap,
AutomationId = "ClickMe",
Command = new Command(async () =>
VerticalStackLayout vsl = new VerticalStackLayout();

vsl.Add(new Button()
{
TaskCompletionSource taskCompletionSource = new TaskCompletionSource();
vsl.Unloaded += (_,_) =>
Text = "Click me and you should see a label appear beneath me",
LineBreakMode = LineBreakMode.WordWrap,
AutomationId = "ClickMe",
Command = new Command(async () =>
{
vsl.Add(new Label { Text = "Hello, World!", AutomationId = "Success" });
taskCompletionSource.TrySetResult();
};
TaskCompletionSource taskCompletionSource = new TaskCompletionSource();
vsl.Unloaded += (_, _) =>
{
vsl.Add(new Label { Text = "Hello, World!", AutomationId = "Success" });
taskCompletionSource.TrySetResult();
};

await Navigation.PushAsync(new ContentPage() { Content = new Label() { Text = "I should just disappear" } });
await Navigation.PushModalAsync(new ContentPage() { Content = new Label() { Text = "I should just disappear" } });

await Navigation.PushAsync(new ContentPage(){ Content = new Label() { Text = "I should just disappear"}});
await Navigation.PushModalAsync(new ContentPage(){ Content = new Label() { Text = "I should just disappear"}});

await taskCompletionSource.Task.WaitAsync(TimeSpan.FromSeconds(5));
await Navigation.PopAsync();
await Navigation.PopModalAsync();
})
});
await taskCompletionSource.Task.WaitAsync(TimeSpan.FromSeconds(5));
await Navigation.PopModalAsync();
await Navigation.PopAsync();
})
});

Content = vsl;
Content = vsl;
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public Issue24434(TestDevice testDevice) : base(testDevice)

[Test]
[Category(UITestCategories.Layout)]
public void TapThenDoubleTap()
public void ModifyingANonVisibleLayoutWorks()
{
App.WaitForElement("ClickMe");
App.Tap("ClickMe");
Expand Down

0 comments on commit 1693c59

Please sign in to comment.