forked from firka/flutter
[web] Fix keyboard popping up unexpectedly on iOS (flutter/engine#29246)
This commit is contained in:
@@ -97,9 +97,11 @@ class ShadowDomHostNode implements HostNode {
|
||||
root.isConnected ?? true,
|
||||
'The `root` of a ShadowDomHostNode must be connected to the Document object or a ShadowRoot.',
|
||||
) {
|
||||
_shadow = root.attachShadow(<String, String>{
|
||||
_shadow = root.attachShadow(<String, dynamic>{
|
||||
'mode': 'open',
|
||||
'delegatesFocus': 'true',
|
||||
// This needs to stay false to prevent issues like this:
|
||||
// - https://github.com/flutter/flutter/issues/85759
|
||||
'delegatesFocus': false,
|
||||
});
|
||||
|
||||
final html.StyleElement shadowRootStyleElement = html.StyleElement();
|
||||
|
||||
@@ -23,6 +23,15 @@ void testMain() {
|
||||
expect(hostNode.node, isA<html.ShadowRoot>());
|
||||
expect((hostNode.node as html.ShadowRoot).host, rootNode);
|
||||
expect(hostNode.node, rootNode.shadowRoot);
|
||||
|
||||
// The shadow root should be initialized with correct parameters.
|
||||
expect(rootNode.shadowRoot!.mode, 'open');
|
||||
if (browserEngine != BrowserEngine.firefox &&
|
||||
browserEngine != BrowserEngine.webkit) {
|
||||
// Older versions of Safari and Firefox don't support this flag yet.
|
||||
// See: https://caniuse.com/mdn-api_shadowroot_delegatesfocus
|
||||
expect(rootNode.shadowRoot!.delegatesFocus, isFalse);
|
||||
}
|
||||
});
|
||||
|
||||
test('Attaches a stylesheet to the shadow root', () {
|
||||
|
||||
Reference in New Issue
Block a user