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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Keyboard Flags and Selected Item Issue

Thread ID:

Created:

Updated:

Platform:

Replies:

146794 Aug 20,2019 12:30 PM UTC Aug 23,2019 08:54 AM UTC Xamarin.Forms 4
loading
Tags: SfAutoComplete
Nic
Asked On August 20, 2019 12:30 PM UTC

Hi All,

I have a couple of issues with SfAutoComplete using Xamarin forms MVVM both are with Android, they work fine in iOS.

I have set some keyboard flags when the SfAutoComplete gets focus to change from Capitalize Words to Capitalize Charactors depending a boolean that is user defined.
this work fine with iOS but on Android it does not take effect, it does work fine if used with an entry.

Also again on Android randomly when using SfAutoComplete if the dropdown is populated but the final word is not in the list or selected from the row of words above the keyboard the app crashes with an index error.

Any help please.

Muneesh Kumar G [Syncfusion]
Replied On August 21, 2019 12:21 PM UTC

Hi Nic, 
 
Greetings from Syncfusion.  
 
Query 1: When the SfAutoComplete gets focus to change from Capitalize Words to Capitalize Characters. 
 
We have analyzed the requirement from our side. You can achieve this by using the custom renderer for the SfAutoComplete. We have prepared the simple sample for your reference. Please try the attached below sample and let us know if you have any concern on this. 
 
Code Snippet: 
public class CustomRendererAndroid : SfAutoCompleteRenderer 
    { 
        public CustomRendererAndroid() 
        { 
        } 
        protected override void OnElementChanged(ElementChangedEventArgs<Syncfusion.SfAutoComplete.XForms.SfAutoComplete> e) 
        { 
            base.OnElementChanged(e); 
            if (Control != null) 
            { 
                Control.FocusChanged += Control_FocusChanged; 
            } 
        } 
        private void Control_FocusChanged(object sender, Com.Syncfusion.Autocomplete.FocusChangedEventArgs e) 
        { 
            if (e.HasFocus) 
            { 
                if (Control != null) 
                { 
                    Control.InputType = Android.Text.InputTypes.TextFlagCapCharacters; 
                } 
            } 
        } 
    } 
 
Query 2:Selected from the row of words above the keyboard the app crashes with an index error. 
 
We have analyzed the reported issue from our side. We are unable to reproduce the reported issue in our end. Please check with the below sample and if the issue mentioned occurs in different scenario. Please modify the sample with the issue reproducing sample which will be helpful for us to analyze further and provide an appropriate solution. 
  
Sample Link: 
 
Regards,  
Muneesh Kumar G 
 


Nic
Replied On August 22, 2019 08:54 AM UTC

Hi Muneesh,

Thank you very much for the Android renderer it works perfectly,
to keep thinks all nice and tidy i would like to use the renderer for iOS but i am stuck with the control type i looked at your sample but have not been able to work out what goes after the Control.

Control.<what goes here> = UITextAutocapitalizationType.AllCharacters;

After creating the Android renderer i have not had the app crash, so must have been something in my code.

Regards
Nic

Nic
Replied On August 22, 2019 11:46 AM UTC

Hi Muneesh,

I've sorted the iOS renderer as below:

var editText = Control.TextField as UITextField;
 editText.AutocapitalizationType = UITextAutocapitalizationType.Words;

thanks for you help.

Regards
Nic
 

Muneesh Kumar G [Syncfusion]
Replied On August 23, 2019 08:54 AM UTC

Hi Nic, 
 
Glad that the issue has been resolved and please get back to us if you need any other assistance.  
 
Regards, 
Muneesh Kumar G 


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

Live Chat Icon For mobile
Live Chat Icon