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

SfAutoComplete Suggestion box hiding under the keyboard on android

SFAutoComplete control's suggestion box is hiding under the keyboard on Android. I have set the placement of the suggestion box to be "top" but it appears that the control does not realize that the keyboard has been displayed and the screen has scrolled up to keep the textbox in focus. Typically the Suggestionbox is rendered where the corresponding textbox was when it was originally clicked. Is there a fix for this? Can I manually set the location of that box? 

Thanks in advance.

14 Replies

HM Hemalatha Marikumar Syncfusion Team January 2, 2020 02:05 PM UTC

Hi Andrew,

Greetings from Syncfusion.

We have analyzed the reported issue of “Suggestion box hiding under the keyboard”. This can be occurred while popup the keyboard, dropdown has been displayed based on the dropdown height. You can full fill this requirement by setting MaximumDropDownHeight as like below code snippet.

Code snippet: 
<autocomplete:SfAutoComplete DisplayMemberPath="Name" MaximumDropDownHeight="200" 
                                     DataSource="{Binding EmployeeCollection}" /> 
  
Please let us know if you have any other queries.

Regards,
 
Hemalatha M. 



AB andrew bednarz January 2, 2020 02:18 PM UTC

Hello, 
Thank you for your suggestion but this does not solve my problem. I'll show a code snippet below. Still when I click to type in the SFAutoComplete box, the suggestion box is hidden by the keyboard, when i hit the back button to hide the keyboard, the suggestion box is shown underneath the box. It seems that the Suggestionbox is rendered where the corresponding textbox was when it was originally clicked, not account for the scroll when the keyboard is shown. 
Thanks

       <SyncAuto:SfAutoComplete DataSource="{Binding PotentialData}" DisplayMemberPath="Description" Text="{Binding Data.DisplayData}" MaximumSuggestion="4" 
                                     MaximumDropDownHeight="200" SuggestionBoxPlacement="Top" NoResultsFoundText="Nothing Found." Watermark="Start Typing">





SP Sakthivel Palaniyappan Syncfusion Team January 5, 2020 03:15 PM UTC

Hi Andrew,

Thanks for your update.

We have analyzed your query  and currently we are validating the reported problem of “Suggestion box is hidden by the keyboard in AutoComplete”. We will update the complete details on 7th January 2020. 
We appreciate until your patience.

Regards,
Sakthivel P. 



HM Hemalatha Marikumar Syncfusion Team January 7, 2020 02:01 PM UTC

Hi Andrew,

Thanks for your patience.

We analyzed, and we were able to reproduce the reported issue. This is a known issue, and we have already raised a query about this issue in the Android issue tracker discussion since we have also used PopWindow for SfAutoComplete, and we have attached a link for reference.

Linkhttps://issuetracker.google.com/issues/128579395  

We suggest you use ComboBox for similar as AutoComplete. Using the DropDownOpen event you can customize the position of the PopWindow in SfComboBox as like below code snippet. 
 
XAML: 
<local:CustomComboBox  x:Name="comboBox" IsEditableMode="True" MultiSelectMode="Delimiter" VerticalOptions="Center" Watermark="Start typing" 
                                     HeightRequest="40"  SuggestionBoxPlacement="Top" 
                                     DisplayMemberPath="Name" MaximumDropDownHeight="300" 
                                     DataSource="{Binding EmployeeCollection}"/> 
  

C#:
 
comboBox.DropDownButtonSettings = new Syncfusion.XForms.ComboBox.DropDownButtonSettings() { Width = 0, Height = 0 }; 
  
Custom Renderer: 
[assembly: ExportRenderer(typeof(CustomComboBox), typeof(ComboBoxRenderer))] 
namespace AutoCompleteSample.Droid 
{ 
  
    public class ComboBoxRenderer : SfComboBoxRenderer 
    { 
        public ComboBoxRenderer(Context context) : base(context) 
        { 
        } 
  
        protected override void OnElementChanged(ElementChangedEventArgs<Syncfusion.XForms.ComboBox.SfComboBox> e) 
        { 
            base.OnElementChanged(e); 
            if (e.NewElement != null) 
            { 
                Control.DropDownOpen += Control_DropDownOpen; 
            } 
        } 
        private void Control_DropDownOpen(object sender, EventArgs e) 
        { 
            if (Control.SuggestionBoxPlacement == Syncfusion.Android.ComboBox.SuggestionBoxPlacement.Top) 
            { 
                Control.GetAutoPopUpWindow().ShowAtLocation(this, GravityFlags.NoGravity, 50, 100); 
            } 
        } 
    } 
  
Please let us know if you have any other queries. 
 
Regards, 
Hemalatha M. 



MA Mark February 9, 2020 02:34 AM UTC

I've also come across this issue as well. I have set the MaximumDropDownHeight to reduce the issue for now, but is it still going to be fixed?


HM Hemalatha Marikumar Syncfusion Team February 10, 2020 10:41 AM UTC

Hi Mark,


 
Query: I have set the MaximumDropDownHeight to reduce the issue for now 
 
Thanks for your update. We are glad to hear that. 
 
Query: is it still going to be fixed? 
 
We would like to let you know that we used the PopupWindow component on Android platform to implement the suggestion box. To display it, we just called the popupWindow.Show(), and we didn't handle any specific position as Android itself handles that. So, we have tried different options, but Android overrides the settings and displays the popup. 

This is the reason we logged a report to Android and there is no progress. We will make every possible way to rectify the same from our side in feature release.

https://issuetracker.google.com/issues/128579395

Please let us know if you have any concerns.

Regards,
Hemalatha M.
 



MA Mark February 14, 2020 12:01 PM UTC

Great to hear, i've commented on the issue on google's bug tracker, hopefully they look into fixing it soon.


DV Divya Venkatesan Syncfusion Team February 17, 2020 09:53 AM UTC

Hi Mark, 
 
Thanks for the update. We are also having followup with the issue and we will share you if we get any updates. 
 
Regards, 
Divya Venkatesan 



AH Amir H replied to Divya Venkatesan January 26, 2021 06:37 AM UTC

Hi Mark, 
 
Thanks for the update. We are also having followup with the issue and we will share you if we get any updates. 
 
Regards, 
Divya Venkatesan 


Hi,
Has this issue been fixed?



SS Suganya Sethuraman Syncfusion Team January 27, 2021 11:52 AM UTC

Hi Amir,

Greetings from Syncfusion.

Still, the Android team doesn't fix the reported issue. so, we have raised a new query report about this issue in the Android issue tracker discussion, and we have attached a link for reference.

Link: https://issuetracker.google.com/issues/178510620

We are also having follow up with the issue and we will share you if we get any updates.

Regards,
Suganya Sethuraman. 



JB John Burns July 20, 2021 10:20 AM UTC

Hello,

I want to follow up on this, any updates on this issue? This is still an issue, the user can't see the suggestion box when the Android's on-screen keyboard is visible, especially in landscape mode.


Thank you



JK Jeya Kasipandi Syncfusion Team July 21, 2021 11:03 AM UTC

Hi John,

Still we are not get any updates on this issue and we will share you if we get any updates.We suggest you set Window.SetSoftInputMode(Android.Views.SoftInput.AdjustResize) in the Main Activity class of Android project after the LoadApplication method to resolve the reported issue. Please find the below code snippet for this

Code snippet  

  public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
    {
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            global::Xamarin.Forms.Forms.Init(this, bundle);
            LoadApplication(new App());
            Window.SetSoftInputMode(Android.Views.SoftInput.AdjustResize);
        }
    }

Please refer the below link for this
https://help.syncfusion.com/xamarin/autocomplete/dealing-with-suggestion-box

Please check with the above and let us know the reported issue resolved or not.

Regards,
Jeya K.  



JB John Burns July 21, 2021 01:09 PM UTC

This has fixed the issue, thank you for your support!



JK Jeya Kasipandi Syncfusion Team July 22, 2021 09:16 AM UTC

Hi John,

Thanks for the update.

We are glad to know that the reported issue has been resolved at your end.

Please let us know if you have any other queries.

Regards,
Jeya K

Loader.
Live Chat Icon For mobile
Up arrow icon