This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Don't update page offset if not visible (#11602)
fixes #10608
- Loading branch information
Showing
5 changed files
with
123 additions
and
2 deletions.
There are no files selected for viewing
97 changes: 97 additions & 0 deletions
97
Xamarin.Forms.Controls.Issues/Xamarin.Forms.Controls.Issues.Shared/Issue10608.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
using System.Threading.Tasks; | ||
using Xamarin.Forms.CustomAttributes; | ||
using Xamarin.Forms.Internals; | ||
|
||
#if UITEST | ||
using Xamarin.Forms.Core.UITests; | ||
using Xamarin.UITest; | ||
using NUnit.Framework; | ||
#endif | ||
|
||
namespace Xamarin.Forms.Controls.Issues | ||
{ | ||
#if UITEST | ||
[Category(UITestCategories.Shell)] | ||
#endif | ||
[Preserve(AllMembers = true)] | ||
[Issue(IssueTracker.Github, 10608, "[Bug] [Shell] [iOS] Locked flyout causes application to freezes when quickly switching between tabs", PlatformAffected.iOS)] | ||
public class Issue10608 : TestShell | ||
{ | ||
public Issue10608() | ||
{ | ||
} | ||
|
||
protected override void Init() | ||
{ | ||
FlyoutBehavior = FlyoutBehavior.Locked; | ||
|
||
AddFlyoutItem("Click"); | ||
AddFlyoutItem("Between"); | ||
AddFlyoutItem("These Flyouts"); | ||
AddFlyoutItem("Really Fast"); | ||
AddFlyoutItem("If it doesn't"); | ||
AddFlyoutItem("Lock test has passed"); | ||
|
||
int i = 0; | ||
foreach(var item in Items) | ||
{ | ||
item.Items[0].AutomationId = $"FlyoutItem{i}"; | ||
item.Items[0].Items.Add(new ContentPage() | ||
{ | ||
Title = "Page" | ||
}); | ||
|
||
i++; | ||
} | ||
|
||
Items.Add(new MenuItem() | ||
{ | ||
Text = "Let me click for you", | ||
AutomationId = $"FlyoutItem{i}", | ||
Command = new Command(async () => | ||
{ | ||
for (int j = 0; j < 5; j++) | ||
{ | ||
CurrentItem = Items[0].Items[0]; | ||
await Task.Delay(10); | ||
CurrentItem = Items[1].Items[0]; | ||
await Task.Delay(10); | ||
} | ||
CurrentItem = Items[0].Items[0]; | ||
}) | ||
}); | ||
|
||
Items[0].Items[0].Items[0].Title = "Tab 1"; | ||
Items[0].Items[0].Items[0].AutomationId = "Tab1AutomationId"; | ||
Items[1].Items[0].Items[0].Title = "Tab 2"; | ||
Items[1].Items[0].Items[0].AutomationId = "Tab2AutomationId"; | ||
|
||
Items[0].FlyoutDisplayOptions = FlyoutDisplayOptions.AsMultipleItems; | ||
Items[1].FlyoutDisplayOptions = FlyoutDisplayOptions.AsMultipleItems; | ||
} | ||
|
||
#if UITEST | ||
[Test] | ||
[Category(UITestCategories.Shell)] | ||
public void ShellWithTopTabsFreezesWhenNavigatingFlyoutItems() | ||
{ | ||
RunningApp.Tap("FlyoutItem6"); | ||
RunningApp.Tap("FlyoutItem0"); | ||
for (int i = 0; i < 5; i++) | ||
{ | ||
RunningApp.WaitForElement("Tab1AutomationId"); | ||
RunningApp.Tap("FlyoutItem0"); | ||
RunningApp.Tap("FlyoutItem1"); | ||
RunningApp.Tap("FlyoutItem0"); | ||
} | ||
|
||
RunningApp.WaitForElement("Tab1AutomationId"); | ||
RunningApp.Tap("FlyoutItem1"); | ||
RunningApp.WaitForElement("Tab2AutomationId"); | ||
RunningApp.Tap("FlyoutItem0"); | ||
RunningApp.WaitForElement("Tab1AutomationId"); | ||
} | ||
#endif | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters