When I hold item on SfListView and floating, i can tap other item of out side SfListView.

こんにちはチームです!

 

SfListViewt に問題があります。
SfListView バージョン : 24.1.41

SfListView を使用しており、DragStartMode は Hold です。

SfListView 上でアイテムをホールドしてフローティングすると、SfListView の外側の別のアイテムをタップできます。

マルチタップできないように設定する方法を教えてください。


7 Replies

SY Suthi Yuvaraj Syncfusion Team March 5, 2024 02:26 PM UTC

Hi Reina Nakano,

We have checked your requirement, we would like to inform you that as per our current implementation when dragging the item if the focus moves out from the listView, the item will be dropped at the final location, we have created a simple sample with two listviews, Please refer the below output video and sample. kindly share your exact requirement or any expected video or any other information that helps us to understand the issue and find the solution as soon as possible.

Regards,

Suthi Yuvaraj.



Attachment: ListView_6b58599f.zip


RN Reina Nakano March 22, 2024 11:04 AM UTC

Hi Team!

thank you for answering my question

I would like to ask for a more specific answer.

Using SfListView and DragStartMode is OnHold
Click and drag the item ①, at the same time I can press another button on the screen (menu hamburger icon on the top left screen ②).
→ How can I disable multi-tap?

 

Please check the diagram that I attached.
The blue frame is SfListView.


sf問い合わせ図.png



SY Suthi Yuvaraj Syncfusion Team March 25, 2024 02:59 PM UTC

Reina Nakano,

We have checked your requirement and replicated the issue where dragging an item on touch and interacting with menu items using another pointer on touch both result in undesired behavior. Upon investigation, touch handling for the parent control was not implemented in our source level. Although we attempted to disable multiple taps at the sample level, it proved ineffective in addressing this specific case.

Please let us know if you have any concerns.



RN Reina Nakano April 4, 2024 02:59 AM UTC

Hi Suthi Yuvaraj

Thanks for your kindly informs my question.

I understand that you have replicated the issue.

Will this issue be fixed?





SY Suthi Yuvaraj Syncfusion Team April 4, 2024 02:54 PM UTC

Reina Nakano,

We would like to let you know that, as mentioned dragging an item on touch and interacting with another touch pointer is undesired behavior, where we can only handle the touch inside the control, we have tried to restrict the touch on the parent when the listview item is on dragging, it is not feasible. whereas you can restrict the touch of the button or any interactive control inside the ItemTemplate, Please refer to the below code snippet for more reference.

Code snippet :

In XAML:


    <syncfusion:SfListView x:Name="listView" ItemDragging="listView_ItemDragging" DragStartMode="OnHold"

                   ItemsSource="{Binding BookInfo}"

                   ItemSize="100">

        <syncfusion:SfListView.ItemTemplate>

            <DataTemplate>

                <Grid ColumnDefinitions="*,50">

                    <Button Grid.Column="1" Text="button" Clicked="CustomContentView_Clicked"/>

                    <Grid Padding="10" Grid.Column="0">

                        <Grid.RowDefinitions>

                            <RowDefinition Height="0.4*" />

                            <RowDefinition Height="0.6*" />

                        </Grid.RowDefinitions>

                        <Label Text="{Binding BookName}" FontAttributes="Bold" TextColor="Teal" FontSize="21" />

                        <Label Grid.Row="1" Text="{Binding BookDescription}" TextColor="Teal" FontSize="15"/>

                    </Grid>

                </Grid>

            </DataTemplate>

        </syncfusion:SfListView.ItemTemplate>

    </syncfusion:SfListView>



In XAML.cs

 private void CustomContentView_Clicked(object sender, EventArgs e)

 {

     if(vm.IsInDragging)

     {

         return;

     }

 }


 private void listView_ItemDragging(object sender, ItemDraggingEventArgs e)

 {

     var dragcontroller = listView.DragDropController;

     var isInDragging = dragcontroller.GetType().GetProperties(BindingFlags.Instance | BindingFlags.NonPublic).FirstOrDefault(x => x.Name.Equals("IsInDragging")).GetValue(dragcontroller);

     vm.IsInDragging = (bool)isInDragging;

 }



Please let us know if you have any concerns,

Regards,

Suthi Yuvaraj


Attachment: ListViewLayout_8d698b43.zip


RN Reina Nakano April 8, 2024 10:28 AM UTC

Hi Team!
Thank you for your support and for attaching the sample.

but I have any question.

Q1. Are there any plans to fix this issue with .NET MAUI support?
Q2. The sample code that you attached is in code-behind format, but I want sample code in Model-View-ViewModel format. Can you make it for me?
Q3. There are several tab using SfListview in our project.So i want to control with touch event or press event because of i want to prevent multi-tapped.
Is there any way to resolve that.

Please check the diagram for the location of the tabs.

sf問い合わせ図_1.png



SY Suthi Yuvaraj Syncfusion Team April 9, 2024 10:11 PM UTC

Reina Nakano,

#Regarding Bug fix

As mentioned earlier in the source level , we can only handle the touch inside the control,Where as the touch in parent control or outside the control will not be handled inside the source.

#Regardin Sample code in MVVM format 

We modified the sample in the possible way to achieve MVVM concept , Please refer the below sample and let us know if you have any concerns.

#Regarding touch and tap events,

In SfListView, you can get the tap action by itemtapped event , when the tap action received inside the control, Please refer the below documentation for more reference.

UG Link:https://help.syncfusion.com/maui/listview/working-with-sflistview#tapped-event

Hope this documentation will help you out, Kindly let us know if you have any concerns.


Attachment: ListViewLayout_5fad328b.zip

Loader.
Up arrow icon