UWP/WP8.1: Disabling pressed button moves focus to Entry, keyboard pops up. Can this be disabled?

cmeerencmeeren USMember ✭✭
edited October 2016 in Xamarin.Forms

I have a sign-in form with a Submit button that gets disabled when clicked and signing in (via Command.CanExecute). This works well on Android and iOS, but on UWP and Windows Phone 8.1, focus is immediately shifted to the first Entry (the username field) when the button is disabled. This pops up the keyboard. Is this a bug, or can this behavior be changed?

I tried disabling the Entry fields too, which alleviates the problem somewhat, but the keyboard still flickers very briefly in and out.

Using Xamarin.Forms 2.3.2.127.

Best Answer

Answers

  • NMackayNMackay GBInsider, University mod

    @cmeeren

    Got the exact same problem and can't find a way round it so far, was going to raise the issue with support as to me it seems like a bug.

  • cmeerencmeeren USMember ✭✭

    @NMackay sure, do that. If you add a link I'll accept that as the answer to help others find the bug report.

  • JohnHardmanJohnHardman GBUniversity mod

    @cmeeren @NMackay - Assuming your sign-on process involves communicating with a service somewhere, is it a cancelable task? If so, could you have a cancel button on your sign-on page, that you explicitly move the focus to before disabling the submit button?

    Alternatively (and I shudder slightly at this), can you add a tiny, transparent (including the border), button that the user cannot see, but that you move the focus to when submit is tapped?

  • cmeerencmeeren USMember ✭✭

    @JohnHardman It's not cancelable, and, as your shudder indicates, moving focus to a transparent button is not a hack I want to rely on. Might have to do until it's fixed, though.

  • NMackayNMackay GBInsider, University mod

    @JohnHardman

    I did think of that and yup, it makes me shudder, haven't had to do something like that since my VB6 days :smile:

    My design is similar and although you can navigate back to the dashboard and cancel via the back you can't cancel as such.

    I'll get a repo together and contact support later, the fact it works in iOS and Droid makes it a bug as the behavior is inconsistent cross platform.

Sign In or Register to comment.