Cannot swipe on Windows (with mouse)
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?
Steps to Reproduce
-
Create a new MAUI project.
-
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
Can confirm, having the same issue when using CarouselView.
Weirdly enough using the scroll wheel on your mouse (kind of) works.
Verified this issue with Visual Studio Enterprise 17.3.0 Preview 1.0 [32414.199.main]. Repro on Windows with above project.
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...)
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>
SwipeView doesn't work on windows10 with mouse /VS2022 Version 17.3.0 Preview 4.0
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
update:: SwipeView doesn't work on windows10 with mouse / VS2022 Community Version 17.3.0 Preview 5.0
same on win 11 with 17.3.0 Preview 4.0
same on win 10 with 17.3.0
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.
@Redth Can we organize a meeting with WinUI Team to review this topic?. Thanks.
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 :-)
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?
Any update on this issue? swipe gesture is not working on Windows with mouse. This is critical issue and we at least need workaround.
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.
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.
I can confirm this problem still exists on Windows 10, VS 2022 version 17.4.2, .Net MAUI 7.0
Using the latest Microsoft.Maui.Controls (7.0.52), VS 2022 17.4.3, .NET 7.0.101 still broken.
@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.
@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.