Skip to content

UiKitView should participate in the Flutter focus tree #34187

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

Closed
amirh opened this issue Jun 10, 2019 · 7 comments
Closed

UiKitView should participate in the Flutter focus tree #34187

amirh opened this issue Jun 10, 2019 · 7 comments
Assignees
Labels
a: platform-views Embedding Android/iOS views in Flutter apps a: quality A truly polished experience a: text input Entering text in a text field or keyboard related problems found in release: 1.21 Found to occur in 1.21 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list platform-ios iOS applications specifically

Comments

@amirh
Copy link
Contributor

amirh commented Jun 10, 2019

Right now selecting a text field inside a WebView doesn't change the framework's focus state so e.g a previously focused Flutter text field is still focused(and will show the caret animation).

On Android we've added added a focus node for AndroidViews which stays in sync with the platform view's focus state.

This is what it currently looks like on iOS when focus is moved from a Flutter text field to a WebView text field:

ezgif com-resize

@amirh amirh added platform-ios iOS applications specifically a: platform-views Embedding Android/iOS views in Flutter apps labels Jun 10, 2019
@amirh amirh added this to the Goals milestone Jun 10, 2019
@amirh
Copy link
Contributor Author

amirh commented Jun 10, 2019

cc @cyanglaz

@VladyslavBondarenko VladyslavBondarenko added the framework flutter/packages/flutter repository. See also f: labels. label Jan 13, 2020
@kf6gpe kf6gpe added the P2 Important issues not at the top of the work list label May 29, 2020
@markusaksli-nc
Copy link
Contributor

markusaksli-nc commented Aug 6, 2020

Reproducible on the latest master 1.21.0-6.0.pre.223 using webview_flutter: ^0.3.22+1. On Android this does not repro but #34169 does instead.

Minimal reproducible code sample
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Sample',
      home: Scaffold(
        appBar: AppBar(
          title: Text('Sample'),
        ),
        body: SingleChildScrollView(
          child: Column(
            children: [
              TextField(),
              TextField(),
              Container(
                height: 400,
                child: WebView(initialUrl: "https://www.google.com/"),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
flutter doctor -v
[✓] Flutter (Channel master, 1.21.0-6.0.pre.223, on Mac OS X 10.15.6 19G73, locale en-GB)
    • Flutter version 1.21.0-6.0.pre.223 at /Users/markus/development/flutter_master
    • Framework revision 6d487355a3 (7 hours ago), 2020-08-05 20:21:02 -0700
    • Engine revision d728f691f4
    • Dart version 2.10.0 (build 2.10.0-3.0.dev d5ff386abe)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.1)
    • Android SDK at /Users/markus/Library/Android/sdk
    • Platform android-30, build-tools 30.0.1
    • Java binary at: /Users/markus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/193.6626763/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.6, Build version 11E708
    • CocoaPods version 1.9.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.0)
    • Android Studio at /Users/markus/Library/Application Support/JetBrains/Toolbox/apps/AndroidStudio/ch-0/193.6626763/Android Studio.app/Contents
    • Flutter plugin version 48.0.2
    • Dart plugin version 193.7361
    • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[✓] Connected device (4 available)
    • Nevercode’s iPhone (mobile) • b668e524315069f3db3661ac11ff1f66afafebdb • ios            • iOS 13.6
    • macOS (desktop)             • macos                                    • darwin-x64     • Mac OS X 10.15.6 19G73
    • Web Server (web)            • web-server                               • web-javascript • Flutter Tools
    • Chrome (web)                • chrome                                   • web-javascript • Google Chrome 84.0.4147.105

• No issues found!

@markusaksli-nc markusaksli-nc added a: quality A truly polished experience a: text input Entering text in a text field or keyboard related problems found in release: 1.21 Found to occur in 1.21 has reproducible steps The issue has been confirmed reproducible and is ready to work on labels Aug 6, 2020
@Hixie Hixie removed this from the None. milestone Aug 17, 2020
@jmagman
Copy link
Member

jmagman commented May 27, 2022

@hellohuanlin also consider adding integration test for this, perhaps added to:
https://github.com/flutter/flutter/blob/master/dev/integration_tests/ios_platform_view_tests/test_driver/main_test.dart

@hellohuanlin
Copy link
Contributor

@jmagman thanks for the info!

@jmagman
Copy link
Member

jmagman commented Sep 21, 2022

@hellohuanlin I believe this was fixed in #105050, correct?

@jmagman jmagman closed this as completed Sep 21, 2022
@hellohuanlin
Copy link
Contributor

@jmagman yep

@github-actions
Copy link

github-actions bot commented Oct 5, 2022

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: platform-views Embedding Android/iOS views in Flutter apps a: quality A truly polished experience a: text input Entering text in a text field or keyboard related problems found in release: 1.21 Found to occur in 1.21 framework flutter/packages/flutter repository. See also f: labels. has reproducible steps The issue has been confirmed reproducible and is ready to work on P2 Important issues not at the top of the work list platform-ios iOS applications specifically
Projects
Development

No branches or pull requests

7 participants