-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Fix crash when dynamically updating Loop in CarouselView #29453
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
Changes from all commits
3d4b317
1218072
8cac881
da4811d
8a48675
29e757a
c44bef4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| <?xml version="1.0" encoding="utf-8" ?> | ||
| <ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
| xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
| x:Class="Controls.TestCases.HostApp.Issues.Issue29411" | ||
| Title="Issue29411"> | ||
| <ContentPage.Resources> | ||
| <x:Array x:Key="MyItems" Type="{x:Type x:String}"> | ||
| <x:String>First</x:String> | ||
| <x:String>Second</x:String> | ||
| <x:String>Third</x:String> | ||
| </x:Array> | ||
| </ContentPage.Resources> | ||
| <VerticalStackLayout> | ||
| <CarouselView x:Name="cview" AutomationId="MauiCarouselView" HeightRequest="300" Loop="True" ItemsSource="{StaticResource MyItems}"> | ||
| <CarouselView.ItemTemplate> | ||
| <DataTemplate x:DataType="x:String"> | ||
| <Grid VerticalOptions="Center" HorizontalOptions="Center"> | ||
| <Border | ||
| Stroke="DarkGray" | ||
| StrokeThickness="2" | ||
| Background="LightBlue" | ||
| Padding="20" | ||
| HorizontalOptions="Center" | ||
| VerticalOptions="Center" | ||
| StrokeShape="RoundRectangle 12"> | ||
| <Label Text="{Binding .}" FontSize="24" HorizontalOptions="Center" VerticalOptions="Center" /> | ||
| </Border> | ||
| </Grid> | ||
| </DataTemplate> | ||
| </CarouselView.ItemTemplate> | ||
| </CarouselView> | ||
| <Button Text="Change Loop" AutomationId="MauiButton" Clicked="Button_Clicked" /> | ||
| </VerticalStackLayout> | ||
| </ContentPage> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| namespace Controls.TestCases.HostApp.Issues; | ||
| [Issue(IssueTracker.Github, 29411, "[Android] CarouselView.Loop = false causes crash on Android when changed at runtime", PlatformAffected.All)] | ||
| public partial class Issue29411 : ContentPage | ||
| { | ||
| public Issue29411() | ||
| { | ||
| InitializeComponent(); | ||
| } | ||
|
|
||
| private void Button_Clicked(object sender, EventArgs e) | ||
| { | ||
| cview.Loop = !cview.Loop; | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| #if !MACCATALYST //Appium Swipe is not working on MACCATALYST | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, will take a look to it. Can you try to use the DragCoordinates method for Mac (with a compilation directive in the test)?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, Will try that out. In my local machine ,
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jsuarezruiz I tried using |
||
| using NUnit.Framework; | ||
| using UITest.Appium; | ||
| using UITest.Core; | ||
|
|
||
| namespace Microsoft.Maui.TestCases.Tests.Tests.Issues; | ||
|
|
||
| public class Issue29411 : _IssuesUITest | ||
| { | ||
| public Issue29411(TestDevice device) : base(device) | ||
| { | ||
| } | ||
|
|
||
| public override string Issue => "[Android] CarouselView.Loop = false causes crash on Android when changed at runtime"; | ||
|
|
||
| [Test] | ||
| [Category(UITestCategories.CarouselView)] | ||
| public void ChangingLoopToFalseShouldNotCrash() | ||
| { | ||
| App.WaitForElement("MauiButton"); | ||
| App.Tap("MauiButton"); | ||
| App.SwipeRightToLeft("MauiCarouselView"); | ||
| App.WaitForElement("MauiCarouselView"); | ||
| } | ||
| } | ||
| #endif | ||
Uh oh!
There was an error while loading. Please reload this page.