Unhandled exception when clicking on far away from a message in SfChat

Hi, I am getting an unhandled exception after adding SfPopup widget to the Chat one (see below).
I defined all the tap events for the messages in chat and all works fine till I click on some distant area within the SfChat widget.
Unfortunately I have no access to the code on top of the exception stack, but it looks like simply swalloing this internal exception will solve it.
Thanks, Vassili
at Syncfusion.XForms.Chat.SfChat.RaiseMessageTapped (Syncfusion.ListView.XForms.ItemTappedEventArgs e) [0x00016] in :0
at Syncfusion.XForms.Chat.ChatListView.OnChatListViewItemTapped (System.Object sender, Syncfusion.ListView.XForms.ItemTappedEventArgs e) [0x00000] in :0
at Syncfusion.ListView.XForms.SfListView.RaiseItemTapped (Syncfusion.ListView.XForms.ItemTappedEventArgs e) [0x00008] in :0
at Syncfusion.ListView.XForms.SelectionController.HandleTouchInteraction (Syncfusion.ListView.XForms.TouchGesture gesture, Syncfusion.ListView.XForms.ListViewItemInfoBase itemInfo, Xamarin.Forms.Point position) [0x000a3] in :0
at Syncfusion.ListView.XForms.ListViewItemInfoBase.HandleTouchInteraction (Syncfusion.ListView.XForms.TouchGesture gesture, Xamarin.Forms.Point position) [0x0008d] in :0
at Syncfusion.ListView.XForms.iOS.ListViewItemRenderer.OnTapped () [0x0003a] in <652a1e59eca74054911bf6876d5914ce>:0
at Syncfusion.ListView.XForms.iOS.ListViewItemRenderer.b__20_1 () [0x0000c] in <652a1e59eca74054911bf6876d5914ce>:0
at UIKit.UIGestureRecognizer+ParameterlessDispatch.Activated () [0x00000] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIGestureRecognizer.cs:90

4 Replies

VA Vassili February 14, 2021 10:51 AM UTC

P.S. Actually same problem is with double tap. To reproduce you can have just one message in the chat area and then subscribe like this:

            sfchat.MessageTapped += Chat_MessageTapped;
            OR:
            sfchat.MessageDoubleTapped += Chat_MessageDoubleTapped;

Then if you tap or double tap somewhere in the empty area far away from any message, the exception occurs and the stack trace is the following:

  at Syncfusion.XForms.Chat.SfChat.RaiseMessageDoubleTapped (Syncfusion.ListView.XForms.ItemDoubleTappedEventArgs e) [0x00016] in <a78d37a2c7b94f89aee6eacac5f1bd92>:0 
  at Syncfusion.XForms.Chat.ChatListView.OnChatListViewItemDoubleTapped (System.Object sender, Syncfusion.ListView.XForms.ItemDoubleTappedEventArgs e) [0x00000] in <a78d37a2c7b94f89aee6eacac5f1bd92>:0 
  at Syncfusion.ListView.XForms.SfListView.RaiseItemDoubleTapped (Syncfusion.ListView.XForms.ItemDoubleTappedEventArgs e) [0x00008] in <ed123c86773e41aca51adc7a8f5f900a>:0 
  at Syncfusion.ListView.XForms.SelectionController.HandleTouchInteraction (Syncfusion.ListView.XForms.TouchGesture gesture, Syncfusion.ListView.XForms.ListViewItemInfoBase itemInfo, Xamarin.Forms.Point position) [0x000f4] in <ed123c86773e41aca51adc7a8f5f900a>:0 
  at Syncfusion.ListView.XForms.ListViewItemInfoBase.HandleTouchInteraction (Syncfusion.ListView.XForms.TouchGesture gesture, Xamarin.Forms.Point position) [0x0008d] in <ed123c86773e41aca51adc7a8f5f900a>:0 
  at Syncfusion.ListView.XForms.iOS.ListViewItemRenderer.OnDoubleTapped () [0x00021] in <652a1e59eca74054911bf6876d5914ce>:0 
  at Syncfusion.ListView.XForms.iOS.ListViewItemRenderer.<OnElementChanged>b__20_3 () [0x0000c] in <652a1e59eca74054911bf6876d5914ce>:0 
  at UIKit.UIGestureRecognizer+ParameterlessDispatch.Activated () [0x00000] in /Users/builder/azdo/_work/1/s/xamarin-macios/src/UIKit/UIGestureRecognizer.cs:90 


PK Pradeep Kumar Balakrishnan Syncfusion Team February 15, 2021 06:48 AM UTC

Hi Vassili, 
 
Thank you for using Syncfusion controls. 
 
We have checked, and able to replicate the issue “Invalid cast exception when we tap other then SfChat message view if Message tapped or Message double tapped event is wired in Xamarin forms” we have already logged a defect report for the same. Planned to fix and include the issue fix by February 16, 2021 scheduled Weekly nuget. We appreciate your patience until then.  
 
Regards, 
Pradeep Kumar B 



VA Vassili February 15, 2021 04:51 PM UTC

Hi Pradeep, thanks a lot for an expected quick fix!
All the best, Vassili


PK Pradeep Kumar Balakrishnan Syncfusion Team February 16, 2021 11:23 AM UTC

Hi Vassili, 
 
We have fixed the reported issue “Invalid cast exception when we tap other then SfChat message view if Message tapped or Message double tapped event is wired in Xamarin forms”and included the issue fix in our latest Weekly NuGet release v18.4.0.43 which is available for download (nuget.org).  
  
We thank you for your support and appreciate your patience in waiting for this update. Please get in touch with us if you would require any further assistance.  
 
Regards, 
Pradeep Kumar B 


Loader.
Up arrow icon