Keyboard Covering Up Messages

Hi,


I am working with SfChat 18.3.0.42. When keyboard is brought up, it is covering the last couple messages instead of pushing them up. I would like to see last messages in chat to be at the bottom of the view when keyboard is up. If there's only few messages, everything's going fine. This is on iOS. Please advice! Need this asap. Thank you.



1 Reply 1 reply marked as answer

KK Karthikraja Kalaimani Syncfusion Team March 25, 2021 11:36 AM UTC

Hi Ben Hotra,

Your requirement can be achieved by loading the SfChat control to inside of ScrollView with HeightRequest applied for SfChat and scroll the ScrollView to top option when the keyboard is open.  Please refer to the below Code snippets.

Code snippet :

 
<ScrollView x:Name="scrollView" VerticalOptions="FillAndExpand">
<sfChat:SfChat x:Name="sfChat"
Messages="{Binding Messages}" HeightRequest="400" ShowIncomingMessageAvatar="False" ShowOutgoingMessageAvatar="False" MessageShape="RoundedRectangle" ShowIncomingMessageAuthorName="False" ShowOutgoingMessageAuthorName="False" ShowIncomingMessageTimestamp="False" ShowOutgoingMessageTimestamp="False"
CurrentUser="{Binding CurrentUser}" />
</ScrollView>
 
 

sfChat.Editor.Focused += Editor_Focused; 

private void Editor_Focused(object sender, FocusEventArgs e)
{
this.scrollView.ScrollToAsync(0, 0, false);
}
 
…. 

Regards,
Karthik Raja 


Marked as answer
Loader.
Up arrow icon