Skip to content
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

Swipe not working when SwipeView is used as base element #6154

Closed
pekspro opened this issue Apr 16, 2022 · 7 comments · Fixed by #14824
Closed

Swipe not working when SwipeView is used as base element #6154

pekspro opened this issue Apr 16, 2022 · 7 comments · Fixed by #14824
Assignees
Labels
area-controls-swipeview SwipeView fixed-in-8.0.0-rc.1.9171 Look for this fix in 8.0.0-rc.1.9171 p/2 Work that is important, but is currently not scheduled for release platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working

Comments

@pekspro
Copy link

pekspro commented Apr 16, 2022

Description

If SwipeView is used as base element in a view, and this view is used in a DataTemplate source in a CollectionView swipe doesn't work, at least on Android (it triggers a crash on Windows).

Demo project

Steps to Reproduce

  1. Create a new Maui application.
  2. Add ItemView.xaml:
    <SwipeView 
                 xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
                 xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
                 x:Class="MauiIssues.ItemView"
                 HeightRequest="80"        
        >

        <SwipeView.LeftItems>
            <SwipeItems>
                <SwipeItem Text="Favorite" BackgroundColor="LightGreen" />
                <SwipeItem Text="Delete" BackgroundColor="LightPink" />
            </SwipeItems>
        </SwipeView.LeftItems>

        <Label Text="Swipe me!" />
    </SwipeView>
  1. Add ItemView.cs:
    namespace MauiIssues
    {
        public partial class ItemView 
        {
            public ItemView()
            {
                InitializeComponent();
            }
        }
    }

4: Add CollectionView on MainPage:

    <CollectionView 
                x:Name="ItemsList"
                ItemSizingStrategy="MeasureFirstItem"
                >
        <CollectionView.ItemTemplate>
            <DataTemplate>
                <r:ItemView />
            </DataTemplate>
        </CollectionView.ItemTemplate>
    </CollectionView>

5: Initialize the list in the constructor:

	namespace MauiIssues;

	public partial class MainPage : ContentPage
	{
		public MainPage()
		{
			InitializeComponent();

			ItemsList.ItemsSource = new string[] { "Hello", "World" }; 
		}
	}

Run the application on Android and try to swipe.

Version with bug

Release Candidate 1 (current)

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

Android 10, I was not able test on other platforms

Did you find any workaround?

Use SwipeView directly in the DataTemplate instead, like in this issue #6153.

Relevant log output

No response

@pekspro pekspro added s/needs-verification Indicates that this issue needs initial verification before further triage will happen t/bug Something isn't working labels Apr 16, 2022
@XamlTest XamlTest added s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage and removed s/needs-verification Indicates that this issue needs initial verification before further triage will happen labels Apr 18, 2022
@XamlTest
Copy link

Verified this issue with Visual Studio Enterprise 17.3.0 Preview 1.0 [32414.199.main]. Repro on Android. Sample Project: 6154.zip

@Redth Redth added the area-controls-swipeview SwipeView label Apr 20, 2022
@Redth Redth added this to the 6.0.300 milestone Apr 20, 2022
@RobertoGFilho
Copy link

On windows plataform this crash below happen :

image

@davidortinau
Copy link
Contributor

Perhaps related to #6018 where SwipeView is used as root element

@davidortinau davidortinau added the p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint label Apr 30, 2022
@jsuarezruiz jsuarezruiz self-assigned this May 3, 2022
@jsuarezruiz
Copy link
Contributor

Tested in main branch and Windows in no longer crashing after merge #6018

@Redth Redth added p/2 Work that is important, but is currently not scheduled for release and removed p/1 Work that is important, and has been scheduled for release in this or an upcoming sprint labels May 3, 2022
@samhouts samhouts modified the milestones: 6.0.300, 6.0.300-servicing May 6, 2022
@Redth Redth modified the milestones: 6.0-servicing, Backlog Aug 30, 2022
@ghost
Copy link

ghost commented Aug 30, 2022

We've moved this issue to the Backlog milestone. This means that it is not going to be worked on for the coming release. We will reassess the backlog following the current release and consider this item at that time. To learn more about our issue management process and to have better expectation regarding different types of issues you can read our Triage Process.

@pekspro
Copy link
Author

pekspro commented Nov 11, 2022

I've updated sample application to .NET 7. The same issue remains.

@samhouts samhouts removed s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels Apr 5, 2023
@Enbi-Zhang
Copy link

Verified repro on Windows 11 with 17.6.0 Preview 7.0. Repro project
MauiIssues-SwipeNotSupportedAsBaseInView.zip

@jinxinjuan jinxinjuan added s/verified Verified / Reproducible Issue ready for Engineering Triage s/triaged Issue has been reviewed labels May 12, 2023
@Eilon Eilon added the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label Jun 20, 2023
@samhouts samhouts modified the milestones: Backlog, Under Consideration Jul 26, 2023
@ghost ghost locked as resolved and limited conversation to collaborators Sep 9, 2023
@samhouts samhouts modified the milestones: Under Consideration, .NET 8 + Servicing Sep 12, 2023
@samhouts samhouts added the fixed-in-8.0.0-rc.1.9171 Look for this fix in 8.0.0-rc.1.9171 label Sep 12, 2023
@Eilon Eilon removed the legacy-area-controls Label, Button, CheckBox, Slider, Stepper, Switch, Picker, Entry, Editor label May 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-controls-swipeview SwipeView fixed-in-8.0.0-rc.1.9171 Look for this fix in 8.0.0-rc.1.9171 p/2 Work that is important, but is currently not scheduled for release platform/android 🤖 s/triaged Issue has been reviewed s/verified Verified / Reproducible Issue ready for Engineering Triage t/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants