|Summary:||No way of cleanly dismissing soft keyboard in UWP|
|Severity:||normal||CC:||anubhav, david.ortinau, ehart, emil.alipiev, jas, jimmy.garrido, paul.dipietro, rui.marinho, v-jawasw|
|Tags:||ac uwp entry keyboard focus||Is this bug a regression?:||Yes|
|Last known good build:|
VS2015 Solution (iOD, Droid & UWP), recreates keyboard issue in UWP
Description NMackay 2016-10-05 15:54:19 UTC
Created attachment 17888 [details] VS2015 Solution (iOD, Droid & UWP), recreates keyboard issue in UWP IN UWP is impossible to dismiss the keyboard if you only have entry fields enabled on a page. In this sample there is two entries, a login button and two other buttons (hidden in UWP due to known modal bug that has been fixed pending PR approval). In Android or iOS when you press return/enter on the soft keyboard the focus is set to the button and despite the button been disabled by the command focus is not passed back to the entry, in UWP focus is always passed back due no other control been enabled on the face or no control that supports focus is available. Test 1: Enter text in username Enter text in password Press enter on soft keyboard (simulates authentication in command) Android: Keyboard is dismissed. UWP: Keyboard remains as focus is passed back to username Test 2: Enter text in username Enter text in password Press back on device to dismiss keyboard Tap Login button Android: Command executes. UWP: Command executes but focus is passed back to username Test 3: Swap the commented entry fields for the ones been used ones in LoginPage.xaml (commented ones disable the entry) Enter text in password Enter text in username Press enter on soft keyboard (simulates authentication in command) Android: Keyboard is dismissed. UWP: Keyboard is dismissed but keyboard flashes and page flickers There seems to be no easy way to dismiss the keyboard in UWP and as the expected behavior works in iOS and Android it has to be considered as a bug. It should be consistent over all three platforms.
Comment 2 Rui Marinho 2017-03-20 19:17:32 UTC
Should be fixed in 2.3.5-pre1
Comment 5 Jimmy [MSFT] 2017-07-13 16:37:12 UTC
I ran the attached project with Forms 2.3.5-pre6 and 18.104.22.168-nightly and I was still able to reproduce the issue. I am setting the report back to confirmed for further investigation.
Comment 6 Jimmy [MSFT] 2017-08-30 18:28:04 UTC
Test #1 and #3 in the description are fixed in 2.4.0-pre2. Pressing Enter now dismisses the keyboard and it does not reappear or flicker. Regarding test #2, the fix does not apply in this case because the keyboard has already been dismissed. Since the login command disables the Buttons on the page, focus will be passed to another control due to how UWP behaves. The recommended approach would be to also disable the Entry controls when the commands runs, as in test #3, in order to ensure consistent behavior across the platforms.