Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] Disabling Swipe view not handling tap gesture events on the content in iOS of Xamarin Forms #11969

Closed
john-heaven opened this issue Aug 31, 2020 · 1 comment · Fixed by #12942
Labels
a/swipeview in-progress This issue has an associated pull request that may resolve it! p/iOS 🍎 t/bug 🐛

Comments

@john-heaven
Copy link

Description

I use the SwipeView for CollectionView in Xamarin Forms Application. Sample code as follow:

<collectionviewdemos:CustomView x:Name="collectionView"
                                    SelectionChanged="collectionView_SelectionChanged"
                                    ItemsSource="{Binding Monkeys}">
        <collectionviewdemos:CustomView.ItemTemplate>
            <DataTemplate>
                <SwipeView SwipeStarted="SwipeView_SwipeStarted"
                            IsEnabled="False">
                    <SwipeView.LeftItems>
                        <SwipeItems SwipeBehaviorOnInvoked="Close"
                                    Mode="Reveal">
                            <SwipeItem Text="Favorite"
                                        IconImageSource="favorite.png"
                                        BackgroundColor="LightGreen"
                                        Command="{Binding Source={x:Reference collectionView}, Path=BindingContext.FavoriteCommand}"
                                        CommandParameter="{Binding}" />
                            <SwipeItem Text="Delete"
                                        IconImageSource="delete.png"
                                        BackgroundColor="LightPink"
                                        Command="{Binding Source={x:Reference collectionView}, Path=BindingContext.DeleteCommand}"
                                        CommandParameter="{Binding}" />
                        </SwipeItems>
                    </SwipeView.LeftItems>
                    <Grid BackgroundColor="White"
                            IsEnabled="True"
                            Padding="10">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="Auto" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                        </Grid.ColumnDefinitions>
                        <Image Grid.RowSpan="2"
                                Source="{Binding ImageUrl}"
                                Aspect="AspectFill"
                                HeightRequest="60"
                                WidthRequest="60" />
                        <Label Grid.Column="1"
                                Text="{Binding Name}"
                                FontAttributes="Bold" />
                        <Button Grid.Row="1"
                                Grid.Column="1"
                                Text="one"
                                Clicked="Button_Clicked" />
                    </Grid>
                </SwipeView>
            </DataTemplate>
        </collectionviewdemos:CustomView.ItemTemplate>
    </collectionviewdemos:CustomView>

When setting IsEnabled be False for SwipeView. The Entry can not be interactive in iOS device, however works in Android.

From Xamarin Forms SwipeView document , if setting its IsEnabled property to false,

This will prevent users from being able to swipe content to reveal swipe items.

However , it not works in iOS.

Steps to Reproduce

From above shared code.

Basic Information

  • IDE: Visual Studio 16.7.2
  • Platform Target Frameworks:
    • iOS: 13.6
    • Android: 9.0
  • Nuget Packages: Xamarin Forms 4.8.0.1269

Screenshots

Android (works) :

iosgif

iOS (no effect):

iosgif

@john-heaven john-heaven added s/unverified New report that has yet to be verified t/bug 🐛 labels Aug 31, 2020
@samhouts samhouts added this to New in Triage Aug 31, 2020
@jsuarezruiz
Copy link
Contributor

Thanks for the detailed feedback. it seems to be similar or the same as: #11968

@hartez hartez added p/iOS 🍎 and removed s/unverified New report that has yet to be verified labels Sep 5, 2020
@hartez hartez added this to To do in iOS Ready For Work via automation Sep 5, 2020
@hartez hartez removed this from New in Triage Sep 5, 2020
@hartez hartez added this to Backlog in SwipeView via automation Sep 5, 2020
@samhouts samhouts added this to the 5.0.0 milestone Sep 8, 2020
@samhouts samhouts added this to To do in vNext+1 (5.0.0) Sep 8, 2020
@samhouts samhouts removed this from the 5.0.0 milestone Nov 2, 2020
@jsuarezruiz jsuarezruiz added the in-progress This issue has an associated pull request that may resolve it! label Nov 23, 2020
@jsuarezruiz jsuarezruiz moved this from Backlog to In Progress in SwipeView Nov 23, 2020
iOS Ready For Work automation moved this from To do to Done Dec 18, 2020
SwipeView automation moved this from In Progress to Done Dec 18, 2020
rmarinho added a commit that referenced this issue Dec 18, 2020
…2942) fixes #11969 fixes #11968

* Added repro sample

* Fix the issue

* Added UITest

Co-authored-by: Rui Marinho <me@ruimarinho.net>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/swipeview in-progress This issue has an associated pull request that may resolve it! p/iOS 🍎 t/bug 🐛
Projects
SwipeView
  
Done
Development

Successfully merging a pull request may close this issue.

4 participants