ThexXTURBOXx / flutter_web_auth_2

Flutter plugin for authenticating a user with a web service
https://pub.dev/packages/flutter_web_auth_2
MIT License
51 stars 50 forks source link

Keyboard not showing when activating text field in web view #17

Closed tp closed 1 year ago

tp commented 1 year ago

Describe the bug

We use this plugin in conjunction with Azure AD to sign into company accounts.

Bringing up the the "in-app browser" (ASWebAuthenticationSession) on iOS works fine, but sometimes tapping into the username/email field in the Microsoft login page does not bring up the keyboard. (The field is also auto-focused on the initial page, but alas the keyboard is not showing.)

I see no errors in the console, and the login screen of our Flutter app is also not doing anything "special" with the Keyboard (no Flutter-field even had focus until this point), so I don't have a guess as to what could be the issue here right now.

To Reproduce

Steps to reproduce the behavior:

  1. Launch our sign in URL with flutter_web_auth_2
  2. Get redirected to the Microsoft-hosted login page

Expected behavior

The in-app browser should work normally. Focusing a text field should bring up the keyboard.

Screenshots

CleanShot 2022-10-24 at 12 35 49@2x

As you can see the field is active (showing the menu), but the keyboard has not shown.

Device

tp commented 1 year ago

Seems like this was also a known issue before the fork: https://github.com/LinusU/flutter_web_auth/issues/120

tp commented 1 year ago

Here a similar issue seems to occur with SwiftUI / native code: https://developer.apple.com/forums/thread/661132

Though a bit surprised that I don't find any reports on StackOverflow etc. if this would be a broader issue.

ThexXTURBOXx commented 1 year ago

This seems like it is a broader issue. However, just for testing: Could you try setting the preferEphemeral parameter to true and false if that makes a difference?

tp commented 1 year ago

This seems like it is a broader issue. However, just for testing: Could you try setting the preferEphemeral parameter to true and false if that makes a difference?

The issue is present with both variants of preferEphemeral.

ThexXTURBOXx commented 1 year ago

That's weird. But that being said, I co not think this is an issue with flutter_web_auth_2, but rather again just some weird behavior on Apple's side of things. Since I do not own Apple devices, I will not be able to fix this myself probably. Maybe, there is something in the documentation that you could try, but I have no idea (and Apple's documentation is very incomplete anyways)

tp commented 1 year ago

FYI, this seems fixed for me since iOS 16.1.1 (or maybe even earlier, but this is the oldest version where I can reliable log in).

ThexXTURBOXx commented 1 year ago

Interesting, thanks for the update! I will update the troubleshooting guide accordingly and link to this issue. If there are any further problems, please let me know :)