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

SOLVED: Show Keyboard on sfautocomplete Focus() in iOS

Thread ID:

Created:

Updated:

Platform:

Replies:

150699 Jan 16,2020 03:23 PM UTC Jan 17,2020 08:51 AM UTC Xamarin.Forms 2
loading
Tags: SfAutoComplete
Marcus
Asked On January 16, 2020 03:23 PM UTC

Hi all,

I am very new to Xamarin.Forms and the Syncfusion controls.

I implemented two views with the autocomplete controls

When the view pops I am raising the Focus() event on the autocomplete control in OnAppearing. This raises the keyboard. Perfect.

        protected override void OnAppearing()
        {
            autocomplete.Focus();
        }

However I also have a SAVE button which will save the selected text. I then want to clear the autocomplete and raise the focus event again.
The control does not receive the focus and no keyboard pops up.
I also implemented a custom renderer on the 2nd form, as I wanted the numeric keyboard only. Same problem with the focus on the 2nd time.

btnSave.Pressed += (sender, e) =>
            {
                String r = (String)autocomplete.SelectedItem;

                if (String.IsNullOrEmpty(r))
                {
                    lblResult.Text = "No result";
                    lblResult.BackgroundColor = Color.Red;
                    autocomplete.Text = String.Empty; // or 
autocomplete.Clear(), no difference         
                    autocomplete.Focus();

                }
                else {
                    lblResult.Text = (String)autocomplete.SelectedItem;
                    lblResult.BackgroundColor = Color.Green;
                    autocomplete.Text = String.Empty;
                    autocomplete.Focus();

                }
              

            };

Does anyone have a clue?

All the best from Germany

Marcus


Marcus
Replied On January 16, 2020 05:51 PM UTC

SOLVED it myself.

I is an issue in XAMARIN.FORMS.

I should not have used the PRESSED, but the RELEASED event on the button.
After PRESSED, the RELEASED sets the Focus back to the BUTTON.

Taking Focus() away in PRESSED to

            btnSave.Released += (sender, e) =>
            {
                autocomplete.Focus();

            };

solved it.

Rabhia Beham Kathar Mideenar [Syncfusion]
Replied On January 17, 2020 08:51 AM UTC

Hi Marcus,

Thanks for the update.

Please let us know if you have any other queries.

Regards,
Rabhia Beham K.

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