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. Image for the cookie policy date

Keyboard is not disappear after Decline or Accept

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

1 Reply

JP Jagadeesan Pichaimuthu Syncfusion Team 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 


Loader.
Live Chat Icon For mobile
Up arrow icon