maui icon indicating copy to clipboard operation
maui copied to clipboard

Cannot swipe on Windows (with mouse)

Open pekspro opened this issue 4 years ago • 30 comments

Description

If I add an SwipeView on a page, I cannot use this on Windows. If I try to swipe it with a mouse nothing happens. Is only touch supported?

Demo code

Steps to Reproduce

  1. Create a new MAUI project.

  2. Add the following code on the main page:

         <SwipeView>
             <SwipeView.LeftItems>
                 <SwipeItems>
                     <SwipeItem Text="Favorite" BackgroundColor="LightGreen" />
                     <SwipeItem Text="Delete" BackgroundColor="LightPink"
                    />
                 </SwipeItems>
             </SwipeView.LeftItems>
             <Grid HeightRequest="60" BackgroundColor="LightGray">
                 <Label Text="Swipe right" HorizontalOptions="Center" VerticalOptions="Center" />
             </Grid>
         </SwipeView>
    

Version with bug

Release Candidate 1 (current)

Last version that worked well

Unknown/Other

Affected platforms

Windows

Affected platform versions

Windows 10.0.17763.0

Did you find any workaround?

No workaround found.

Relevant log output

No response

Depends on

  • [ ] https://github.com/microsoft/microsoft-ui-xaml/issues/8544

VS bug #1779663

pekspro avatar Apr 16 '22 05:04 pekspro

Can confirm, having the same issue when using CarouselView.

Weirdly enough using the scroll wheel on your mouse (kind of) works.

DoubleDBE avatar Apr 17 '22 15:04 DoubleDBE

Verified this issue with Visual Studio Enterprise 17.3.0 Preview 1.0 [32414.199.main]. Repro on Windows with above project.

XamlTest avatar Apr 18 '22 01:04 XamlTest

I can confirm it is also not working for me on Windows 10 and Windows 11. But it does work if you run the Android APK on Windows Subsystem for Android on Windows 11.... (just if it is still not supported by WinUI...)

rogerbriggen avatar May 02 '22 13:05 rogerbriggen

I can repoduce this issue. Visual Studio 17.3.0 Preview 1.1. It can work on Andriod but not Windows side.

<CollectionView> // Vertical Orientation
  <DataTemplate>
        <SwipeView>
            ...
        </SwipeView>
   </DataTemplate>
</CollectionView>

liplum avatar May 28 '22 05:05 liplum

SwipeView doesn't work on windows10 with mouse /VS2022 Version 17.3.0 Preview 4.0

deaa-aldeen avatar Jul 24 '22 17:07 deaa-aldeen

I'm also having the same issue with SwipeView not working on Windows 10 with Mouse. VS 2022 Professional Version 17.3.0 Preview 4.0

TPullen21 avatar Jul 26 '22 17:07 TPullen21

update:: SwipeView doesn't work on windows10 with mouse / VS2022 Community Version 17.3.0 Preview 5.0

deaa-aldeen avatar Jul 26 '22 18:07 deaa-aldeen

same on win 11 with 17.3.0 Preview 4.0

donbing avatar Aug 08 '22 08:08 donbing

same on win 10 with 17.3.0

damonpkuml avatar Aug 21 '22 16:08 damonpkuml

SwipeView in MAUI (Windows) makes use of the SwipeControl control available in WinUI https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.swipecontrol The behavior you describe is the expected and there are requests to make it compatible with mouse: https://github.com/windows-toolkit/WindowsCommunityToolkit/issues/1828

We need to sync with WinUI team to allow this kind of interacction, or, replace the SwipeControl by a custom MauiSwipeView WinUI UserControl.

jsuarezruiz avatar Aug 24 '22 07:08 jsuarezruiz

@Redth Can we organize a meeting with WinUI Team to review this topic?. Thanks.

jsuarezruiz avatar Aug 24 '22 07:08 jsuarezruiz

I just want to remind on this issue too: https://github.com/dotnet/maui/issues/7757

While I would love to see mouse support for swipe, it is not very useful if it causes crashes :-)

pekspro avatar Aug 24 '22 12:08 pekspro

I tried this workaround, event is fired but SwipeItems don't show:

<SwipeView.GestureRecognizers>
      <TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped" />
</SwipeView.GestureRecognizers>
    private void TapGestureRecognizer_Tapped(object sender, EventArgs e)
    {
        (sender as SwipeView).Open(OpenSwipeItem.RightItems);
    }

@jsuarezruiz Any idea to have it work until the mouse get compatible?

sinsedrix avatar Sep 28 '22 13:09 sinsedrix

Any update on this issue? swipe gesture is not working on Windows with mouse. This is critical issue and we at least need workaround.

TamerIrdais avatar Oct 03 '22 06:10 TamerIrdais

SwipeView in MAUI (Windows) makes use of the SwipeControl control available in WinUI https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.swipecontrol The behavior you describe is the expected and there are requests to make it compatible with mouse: CommunityToolkit/WindowsCommunityToolkit#1828

We need to sync with WinUI team to allow this kind of interacction, or, replace the SwipeControl by a custom MauiSwipeView WinUI UserControl.

@jsuarezruiz Any update or time estimate from the WInUI team on when this is going to be fixed? we need that fix ASAP.

TamerIrdais avatar Oct 13 '22 05:10 TamerIrdais

I can confirm that this problem still exists on 17.4.0 Preview 6 for Maui 7.0 Preview. It works as expected with Android. I am unable to test on iOS.

IndianaGary avatar Nov 01 '22 05:11 IndianaGary

I can confirm this problem still exists on Windows 10, VS 2022 version 17.4.2, .Net MAUI 7.0

davepruitt avatar Dec 08 '22 18:12 davepruitt

Using the latest Microsoft.Maui.Controls (7.0.52), VS 2022 17.4.3, .NET 7.0.101 still broken.

fscopel avatar Jan 07 '23 22:01 fscopel

@jsuarezruiz you may have some information about a estimated timeframe when this problem will be solved?

unfortunally there at the moment are a lot of tickets where no information is provided to the community what so ever.. we depend on such features to go live. This not talking with us about brings problems with our clients, since we cant give them timeframes.

ghost avatar Jan 25 '23 07:01 ghost

@jsuarezruiz you may have some information about a estimated timeframe when this problem will be solved?

unfortunally there at the moment are a lot of tickets where no information is provided to the community what so ever.. we depend on such features to go live. This not talking with us about brings problems with our clients, since we cant give them timeframes.

Sure thing. SwipeView in MAUI (Windows) makes use of the SwipeControl control available in WinUI https://docs.microsoft.com/en-us/uwp/api/windows.ui.xaml.controls.swipecontrol The actual behavior is the expected and there are requests to make it compatible with mouse: https://github.com/CommunityToolkit/WindowsCommunityToolkit/issues/1828

We have some conversations with the WinUI team. If SwipeControl does have mouse support we will keep SwipeControl. In case of not being able to have it before the .NET 8 timeframe we will use this PR creating our own implementation. https://github.com/dotnet/maui/pull/11229 (We need to complete this implementation if finally we choose this approach)

It's a decision that depends on multiple teams etc, but I hope to be able to share more specific details soon.

jsuarezruiz avatar Jan 25 '23 11:01 jsuarezruiz