We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Keyboard is not disappear after Decline or Accept

Thread ID:

Created:

Updated:

Platform:

Replies:

142269 Jan 24,2019 09:37 AM UTC Jan 25,2019 10:35 AM UTC Xamarin.Forms 1
loading
Tags: SfPopup
alon
Asked On January 24, 2019 09:37 AM UTC

MySfPopupLayout contains Entry control.
When the Entry control is focused a Keyboard is shown.
When the user clicks the Decline or Accept button, the pop view is disappeared, but the keyboard stays.
Which makes the user close it manually.
The SfPopupLayout is opened on top ofSfListView, and I tested it on Android.
Best regards. alon

Jagadeesan Pichaimuthu [Syncfusion]
Replied On January 25, 2019 10:35 AM UTC

Hi Alon, 

Thanks for using Syncfusion product. 

You can achieve your requirement by using the platform specific keyboard using DependencyService in AcceptButtonCommand. Please find the following code snippet for your reference. 

PCL: 

public interface IKeyBoard 
{ 
    void HideKeyboard(); 
}                                                  


Android: 

internal class CustomKeyBoardAndroid : PopupSample.IKeyBoard 
{ 
    public void HideKeyboard() 
    { 
        var context = Forms.Context; 
        var inputMethodManager = context.GetSystemService(Context.InputMethodService) as InputMethodManager; 
        if (inputMethodManager != null && context is Activity) 
        { 
            var activity = context as Activity; 
            var token = activity.CurrentFocus?.WindowToken; 
            inputMethodManager.HideSoftInputFromWindow(token, HideSoftInputFlags.None); 
 
            activity.Window.DecorView.ClearFocus(); 
        } 
    } 
} 



iOS: 

internal class CustomKeyBoardiOS : PopupSample.IKeyBoard 
{ 
    public void HideKeyboard() 
    { 
        UIApplication.SharedApplication.KeyWindow.EndEditing(true); 
    } 
} 


We have prepared sample and you can download from the following link, 


Let us know whether this helps also if you need any further assistance on this. 

Regards, 
Jagadeesan 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;