dotMorten / MauiEx

A set of .NET MAUI controls
Apache License 2.0
224 stars 55 forks source link

After selecting an item, the keyboard automatically switches to English #57

Closed scriptBoris closed 4 years ago

scriptBoris commented 4 years ago

After selecting an item, the keyboard automatically switches to English

I use RU and EN

dotMorten commented 4 years ago

@scriptBoris Which platform are you using? Can you provide a sample app that demonstrates the problem and the detailed steps to reproduce? (preferably a screen recording) AFAIK there's nothing this control can do to cause a keyboard language change.

scriptBoris commented 4 years ago

Anroid, no more time

ta-yamaoka commented 4 years ago

@scriptBoris Since TextView.InputType is restricted, keyboard switching may not be possible depending on the type of IME. https://github.com/dotMorten/XamarinFormsControls/blob/master/AutoSuggestBox/Platform/NativeAutoSuggestBox.Android.cs#L31

Use a custom render and override the method as shown below.

protected override AndroidAutoSuggestBox CreateNativeControl()
{
    var control = base.CreateNativeControl();
    if (!control.InputType.HasFlag(InputTypes.ClassText))
    {
        control.SetRawInputType(InputTypes.ClassText);
    }
    return control;
}