Issues I found while testing the control this weekend

So I've been trying the SfChat control this weekend and this is what I found.

  • SendMessage event handled documentation is wrong. It states that if the e.Handled is set to false, the message is not added to the collection. It works the other way around, if e.Handled is set to true, it does not get added to the collection.
  • When overriding the e.Handled, the Editor control doesn’t clear out the text and overriding it with ChatView.Editor.Text = string.Empty doesn’t do anything until a new item is added to the list.
  • The keyboard automatically collapses on Android after a new message has been added to the collection even if SetKeyboardAlways is set to true.
  • When allowing multiple lines on iOS and the number of lines > 1 the Editor placeholder text is no longer centered vertically in the control
  • The background color of the input field and rounded border (corner radius) can not be overriden
  • The listview sometimes doesn't scroll to the last item when the keyboard animates into visible on iOS
I've created a very minimal Github repository for these issues which can be found at:



6 Replies 1 reply marked as answer

KK Karthikraja Kalaimani Syncfusion Team September 2, 2020 04:24 AM UTC

Hi Erlend,

Currently, we are validating all reported issue in your sample. We will validate and update you further details on or before 3rd Sep 2020. We appreciate your patience until then.

Regards,
Karthik Raja
 



KK Karthikraja Kalaimani Syncfusion Team September 3, 2020 12:24 PM UTC

Hi Erlend,

Thanks for your patience.

Query 1 :  SendMessage event handled documentation is wrong.

We have checked your application and we saw that you have added the message to Message collection after setting e.handled set to true. So, only the new message is reflected to SfChat conversation. Please don’t add the new message to the collection when e.handled is set as true.  Also, we applied e.handled as false and checked the behavior, new the message is added to the collection and reflected back to SfChat conversion as expected.

Query 2:  Editor control doesn’t clear out the text and overriding it with ChatView.Editor.Text = string.Empty doesn’t do anything until a new item is added to the list. 
 

In current implemention of SfChat, we cleared the editor text after the new message is added to the collection. So only the text is not clear until a new message is added to the conversation. If you want clear the text when e.handled set as true put delay as 100 milliseconds because we are maintaining the editor text after the SendMessage event completed in our source.

Query 3 : The keyboard automatically collapses on Android after a new message has been added to the collection even if SetKeyboardAlways is set to true.

This property is not applicable for the Android platform and the keyboard will be hidden after a message is sent or when the focus is lost. Refer the below workaround to show the keyboard always in the android platform.

In the MainActivity.cs of your Xamarin.Forms.Android project, override the CurrentFocus property and in its getter, if SfChatRenderer.IsChatEditorFocused() method returns true, then return null, else return base.CurrentFocus as shown below.

Code snippet :

 
 
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
...
public override View CurrentFocus
{
get
{
if (SfChatRenderer.IsChatEditorFocused(base.CurrentFocus))
{
return null;
}
return base.CurrentFocus;
}
} ...
 

Query 5 : The background color of the input field and rounded border (corner radius) cannot be overridden.

Please refer to the below workaround for both requirements.

Code snippet :

 
 

..
SfBorder border;  


var listview = (SfListView)ChatView.GetType().GetRuntimeProperties().FirstOrDefault(x => x.Name.Equals("ChatListView")).GetValue(ChatView);  
            listview.Loaded += Listview_Loaded;

FooterView footerView = (FooterView)(
this.ChatView.Content as Grid).Children[1];  
            ContentView contentView = (ContentView)(footerView as Grid).Children[1];  
            border = (contentView.Content as SfBorder);  
            border.BackgroundColor = Color.LightGray;  
            (border.Content as Grid).BackgroundColor = Color.LightGray;  
            ((border.Content as Grid).Children[0] as Editor).BackgroundColor = Color.LightGray;

….
        
private void Listview_Loaded(object sender, ListViewLoadedEventArgs e)  
        {  
            border.CornerRadius = new Thickness(5, 5, 5, 5);  
        }  

Regarding Query 4 and Query 6, we need some more time to validate the reported issues. So, we will validate and update you further details on or before 7th Sep 2020. We appreciate your patience until then.

Regards,
Karthik Raja 
 



KK Karthikraja Kalaimani Syncfusion Team September 7, 2020 01:04 PM UTC

Hi Erlend,

We need some more time to check the reported issues in Xamarin forms iOS platform. We will update further details on or before 9th Sep 2020. We appreciate your patience until then.

Regards,
Karthik Raja




KK Karthikraja Kalaimani Syncfusion Team September 9, 2020 02:40 PM UTC

 
Hi Erlend,

Thanks for your patience.

We could able to reproduce the issue “Editor placeholder text is no longer centered vertically in the control”. Currently we are validating the issue in source level. We will update further details on or before 11th September 2020. We appreciate your patience until then.

Regarding the issue “listview sometimes doesn't scroll to the last item when the keyboard animates”, we could not able to reproduce the issue in our end. The listview scrolls perfectly as expected. So, could you please attach video of the issue to proceed further.

Regards,
Karthik Raja 



KK Karthikraja Kalaimani Syncfusion Team September 11, 2020 02:31 PM UTC

Hi Erlend,

Thanks for your patience.

We have analyzed the reported issue “Placeholder text is not in vertically center” in Xamarin forms iOS and logged bug report the same. We will fix the issue and include the fix in our upcoming weekly nuget release which is scheduled on 6th October 2020. We appreciate your patience until then.

Regards,
Karthik Raja 



KK Karthikraja Kalaimani Syncfusion Team October 21, 2020 11:38 AM UTC


Hi Erlend,

We are glad to let you know that we have fixed the reported issue and included the fix in our weekly NuGet update version v18.3.0.42 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,
Karthik Raja 


Marked as answer
Loader.
Up arrow icon