5
votes

I'm experiencing a strange bug(?) with my uwp app.

I have a page with multiple textboxes for user input that each have the InputScope set to number, which then opens the keyboard in tablet mode as expected. However if you tap on the next box the keyboard closes and a second tap is needed to open the keyboard. This also happens if the user hits tab to switch boxes.

I presume this has something to do with the Focus() event firing before the previous textbox has fired the loss of focus event but im unsure how to override the behavior.

How can i prevent the onscreen keyboard from closing, but also make sure the correct inputscope is still maintained?

Edit: Upon further investigation, the issue seems to be almost random. Sometimes you can move to different boxes and it remains open but other times it closes the keyboard every time.

3
Did you ever find a solution to this? I'm still experiencing issues.iandavidson1982

3 Answers

3
votes

This issue has been resolved with some others, in Windows 10 version 1803 released on 30th April, 2018.

1
votes

You can try to play with InputPane that is a container for on-screen keyboard. For example, doing a small delay once the pane is trying to hide, then detect attempts to show the pane again (and cancel pending hide).

    myPane = InputPane.GetForCurrentView();
    myPane.Showing += myShowingHandler();
    myPane.Hiding += myHidingHandler();

At least, you can receive a size of underlying screen region on the pane showing so you can put a placeholder (margin or dummy grid) on your UI to prevent it jumping up and down on keyboard show/hide.

0
votes

I tried your case on my WP but I cannot reproduce your experience: KeyboardWorking

When I tap to other TextBox, keyboard stays opened and I can continue typing. Keyboard hides as expected when I tap somewhere to whitespace.

Don't you have keyboard connected to your device?