Open pieterlr opened 5 years ago
I also encountered this problem, have you solved it? I want to record the last keyboard type. When I next input, I switch directly to the last keyboard type. The data I found is basically setting the keyboard type. There is no way to get the keyboard type.
Description
I have a behavior on an Entry control. The behavior was to add a mask to the text while you enter it (from https://xamarinhelp.com/masked-entry-in-xamarin-forms/).
I noticed that whenever the behavior applied the mask, the keyboard was set back to the default one. IE if I set focus to the entry, then change the keyboard to the number keyboard and type numerical characters, the keyboard would switch back to the alphabet keyboard as soon as the mask was added.
I narrowed it down to these two lines that appear to be causing this: var entry = sender as Entry; entry.Text = "foo";
(in OnEntryTextChanged in the behavior).
Steps to Reproduce
Expected Behavior
"foo" displays in the entry and the keyboard is still the numeric keyboard.
Actual Behavior
"foo" displays in the entry, BUT the keyboard is now back to the default one.
Basic Information
This seems to be only on Android.
Screenshots
Default keyboard when you tap into the entry (step 1):
Numeric keyboard (Step 2):
Keyboard defaulted after step 3:
This is the test app I've used: App4.zip