Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[web] Fix keyboard popping up unexpectedly on iOS #29246

Merged
merged 2 commits into from Oct 20, 2021

Conversation

mdebbar
Copy link
Contributor

@mdebbar mdebbar commented Oct 19, 2021

Enabling delegatesFocus in the shadow root makes input fields retain focus until the user clicks outside of the shadow root. In our case, the shadow root is the container for the entire app, so any click in the app causes the keyboard to appear again.

By disabling delegatesFocus, the shadow root behaves the same as the entire document.

This can be observed even in the Chrome browser on desktop. Check this jsfiddle.

Fixes flutter/flutter#85759
Fixes flutter/flutter#85829

@mdebbar mdebbar added the platform-web Code specifically for the web engine label Oct 19, 2021
@mdebbar mdebbar requested a review from ditman October 19, 2021 19:27
@google-cla google-cla bot added the cla: yes label Oct 19, 2021
Copy link
Member

@ditman ditman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for tracking this down!

@ditman
Copy link
Member

ditman commented Oct 20, 2021

I think the test failures are due to Firefox and Safari not (yet) supporting the getter that is being used in the expectation of the test!

00:04 �[32m+2�[0m�[31m -1�[0m: test/engine/host_node_test.dart: ShadowDomHostNode Initializes and attaches a shadow root �[1m�[31m[E]�[0m�[0m                                                                                             
  Expected: false
    Actual: <null>

See this:

  • getter support (this only works in Firefox >= 94 and Safari >= 15, both are probably more modern that what we have in our infra.)
  • init parameter support (I wonder if firefox 93 has the focus issue!)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes platform-web Code specifically for the web engine
Projects
None yet
2 participants