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

EditableText blocked PointerEvent after dismissed in IOS with apple pencil supported #142294

Open
wanjm opened this issue Jan 26, 2024 · 23 comments
Labels
a: internationalization Supporting other languages or locales. (aka i18n) a: text input Entering text in a text field or keyboard related problems e: device-specific Only manifests on certain devices f: focus Focus traversal, gaining or losing focus framework flutter/packages/flutter repository. See also f: labels. P3 Issues that are less important to the Flutter project platform-ios iOS applications specifically team-ios Owned by iOS platform team triaged-ios Triaged by iOS platform team

Comments

@wanjm
Copy link

wanjm commented Jan 26, 2024

Steps to reproduce (only on ios)

the follow has fullscreen GestureDetector, which should be able get tap wherever you touch the screen; but with the following operation, the red are in center will stop response to tap;
reproduce step

  1. tap red area => the area will change to green to show EditableText;
  2. click green area to focus the EditableText, then keyboard is displayed on the screen;
  3. input one character (Chinese character) and then fold the keyboard with bottom-right key on keyboard
  4. click white area again to dismiss the EditableText;
  5. click the red area, it should change to green, but it is still red with keyboard popup

note: in step 3, you should input Chinese character (maybe CJK character also reproduce able)

Expected results

int step 5, it should change to green;

Actual results

nothing happened

Code sample

Code sample
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key, required this.title});
  final String title;

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      resizeToAvoidBottomInset: false,
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: Text(widget.title),
      ),
      body:const  Center(
        child: MyWidget(),
      ),
    );
  }
}

class MyWidget extends StatefulWidget {
  const MyWidget({super.key});

  @override
  State<MyWidget> createState() => _MyWidgetState();
}

class _MyWidgetState extends State<MyWidget> {
  final TextEditingController _controller = TextEditingController();
  bool showText = false;
  @override
  Widget build(BuildContext context) {
    var text = showText
        ? ColoredBox(
            color: Colors.green,
            child: EditableText(
              maxLines: null,
              minLines: 2,
              focusNode: FocusNode(),
              controller: _controller,
              style: const TextStyle(
                fontSize: 20,
                color: Colors.black,
              ),
              cursorColor: Colors.black,
              backgroundCursorColor: Colors.black,
            ),
          )
        : null;
    return GestureDetector(
      behavior: HitTestBehavior.opaque,
      onTap: () {
        setState(() {
          showText = !showText;
        });
      },
      child: SizedBox.expand(
        child: Center(
          child: Container(
            width: 400,
            height: 400,
            color: Colors.red,
            child: text,
          ),
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

version of flutter 3.13 and 3.16 . 3.10 is ok;

@wanjm wanjm changed the title Editable blocked PointerEvent EditableText blocked PointerEvent after dismissed Jan 26, 2024
@wanjm
Copy link
Author

wanjm commented Jan 27, 2024

it is reproducible with ipad that can use pencil but don't need to be connected;

@wanjm wanjm changed the title EditableText blocked PointerEvent after dismissed EditableText blocked PointerEvent after dismissed in IO with apple pencil supported Jan 27, 2024
@wanjm wanjm changed the title EditableText blocked PointerEvent after dismissed in IO with apple pencil supported EditableText blocked PointerEvent after dismissed in IOS with apple pencil supported Jan 27, 2024
@wanjm

This comment was marked as off-topic.

@wanjm

This comment was marked as off-topic.

@danagbemava-nc danagbemava-nc added the in triage Presently being triaged by the triage team label Jan 29, 2024
@danagbemava-nc
Copy link
Member

Hi @wanjm, what iPad are you testing on? What version of iOS is it running and what generation of apple pencil does it use?

I tested this on my iPad Air M1 running iOS 17.2 with a 2nd gen apple pencil and I can't seem to reproduce the issue.

Also, what version of flutter specifically are you using? If you could provide any more details that could help us reproduce, that would be appreciated.

Please file new issues regarding the comments I have hidden as off topic so that they can be tracked separately. Please check for duplicates before filing the issues.

Thank you

@danagbemava-nc danagbemava-nc added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 29, 2024
@wanjm
Copy link
Author

wanjm commented Jan 29, 2024

  1. flutter 3.13.9 and 3.16.9 and master (4601341)
  2. iPad 15.2 (7th generation) and iPad 16.5.1(6th generation)
  3. just use the ipad with apple pencil support, but when test , you should use your finger instead of apple pencil, and you need to input Chinese character; other Character will not trigger such problem;

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 29, 2024
@danagbemava-nc
Copy link
Member

Hi @wanjm, I just tried again but still can't repro. Kindly see the video below and let me know if I'm missing anything.

Thank you

RPReplay_Final1706596237.MP4

@danagbemava-nc danagbemava-nc added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 30, 2024
@wanjm
Copy link
Author

wanjm commented Jan 30, 2024

you need to use "right-bottom" key on keyboard to fold the keyboard, from your mp4, it seems step 3 is different; could you please check you do as i asked;

  1. tap red area => the area will change to green to show EditableText; (green without active EditableText)
  2. click green area to focus the EditableText, then keyboard is displayed on the screen; (now EditableText is active and cursor is shine)
  3. input one character (Chinese character) and then fold the keyboard with bottom-right key on keyboard, ( ** now you can see green area but EditableText is not active** );
  4. click white area again to dismiss the EditableText; (change to red);
  5. click the red area, it should change to green, but it is still red with keyboard popup;

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 30, 2024
@wanjm
Copy link
Author

wanjm commented Jan 30, 2024

RPReplay_Final1706599062.mp4

please see my video

@wanjm
Copy link
Author

wanjm commented Jan 30, 2024

maybe you can try #142437 @danagbemava-nc

@wanjm
Copy link
Author

wanjm commented Jan 30, 2024

@danagbemava-nc

  1. please use the PinYin Input method; (Chinese, Simplified, - Pinyin)
  2. please use change your input method to Simplified Chinese

When build with flutter 3.10 there is no such problem;

@danagbemava-nc
Copy link
Member

danagbemava-nc commented Jan 31, 2024

Hi @wanjm, I am using the Simplified keyboard and I am also using the button that dismissed the keyboard on the ipad (not the done button). See the recording below

Can you try upgrading to the latest version of iOS to see if you still have this issue?

RPReplay_Final1706682903.MP4

@danagbemava-nc danagbemava-nc added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 31, 2024
@wanjm
Copy link
Author

wanjm commented Jan 31, 2024

@danagbemava-nc could you please find a pad with old version;
I find another 16.6.1 also have such problem;
many of our users are using 16.6 and below. through 17 has no such issue, I still need to fix it; and I will try to find one 17 pad;

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 31, 2024
@wanjm
Copy link
Author

wanjm commented Jan 31, 2024

@danagbemava-nc I tested it on 17.1, there is no such problem;
could you please find iPad of 15 or 16, and try again.
thanks;

BTW: will flutter team fix this bug if you can reproduce it in IOS 15 or 16;

@huycozy
Copy link
Member

huycozy commented Feb 1, 2024

@wanjm I check this issue on a simulator (iPad Pro, 12.9 inch, 5h gen, iOS 16.4 - support Apple Pencil) but don't see the issue. My result is similar to Daniel's demo above.

This could be a device-specific issue. Could you try upgrading to the latest master channel and retry?

flutter channel master
flutter upgrade

@huycozy huycozy added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Feb 1, 2024
@wanjm
Copy link
Author

wanjm commented Feb 1, 2024

I have tested on master, there is such problem;
I don't think this is device-specific issue, for I have found 3 pad, all have this problem;

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Feb 1, 2024
@huycozy
Copy link
Member

huycozy commented Feb 2, 2024

I just checked this on a physical device (iPad Air 5) but still can't reproduce the issue. Labeling the issue for further information. If you can find any clues, please write in comments.

@huycozy huycozy removed the in triage Presently being triaged by the triage team label Feb 2, 2024
@huycozy huycozy added a: text input Entering text in a text field or keyboard related problems e: device-specific Only manifests on certain devices platform-ios iOS applications specifically framework flutter/packages/flutter repository. See also f: labels. a: internationalization Supporting other languages or locales. (aka i18n) f: focus Focus traversal, gaining or losing focus team-ios Owned by iOS platform team labels Feb 2, 2024
@MitchellGoodwin MitchellGoodwin added P3 Issues that are less important to the Flutter project triaged-ios Triaged by iOS platform team labels Feb 5, 2024
@MitchellGoodwin
Copy link
Contributor

Labelling this as p3 due to the difficulty to reproduce and how odd this case is. Will change priority if it turns out to be more common.

@MitchellGoodwin MitchellGoodwin added the fyi-framework For the attention of Framework team label Feb 5, 2024
@wanjm
Copy link
Author

wanjm commented Feb 6, 2024

I just checked this on a physical device (iPad Air 5) but still can't reproduce the issue. Labeling the issue for further information. If you can find any clues, please write in comments.

could you please record a video, so that i can have a check;

@wanjm
Copy link
Author

wanjm commented Feb 6, 2024

Labelling this as p3 due to the difficulty to reproduce and how odd this case is. Will change priority if it turns out to be more common.

I don't think it is difficult to reproduce as #138395 has found this three month before;
we just need find a physical device and the right version;

@huycozy
Copy link
Member

huycozy commented Feb 6, 2024

could you please record a video, so that i can have a check;

RPReplay_Final1707194211.MP4

@goderbauer goderbauer added the triaged-framework Triaged by Framework team label Feb 6, 2024
@flutter-triage-bot flutter-triage-bot bot removed fyi-framework For the attention of Framework team triaged-framework Triaged by Framework team labels Feb 7, 2024
@wanjm
Copy link
Author

wanjm commented Feb 15, 2024

could you please record a video, so that i can have a check;

RPReplay_Final1707194211.MP4
what is the version of os . it only reproduce with ios 15.x and 16.x ; 17.x has no such problem;

@huycozy
Copy link
Member

huycozy commented Mar 29, 2024

what is the version of os . it only reproduce with ios 15.x and 16.x ; 17.x has no such problem;

It's iPadOS 17.2 (sorry I didn't notice your question, thought it's a quote only)

@wanjm
Copy link
Author

wanjm commented Apr 25, 2024

or any suggestion for me how to avoid this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: internationalization Supporting other languages or locales. (aka i18n) a: text input Entering text in a text field or keyboard related problems e: device-specific Only manifests on certain devices f: focus Focus traversal, gaining or losing focus framework flutter/packages/flutter repository. See also f: labels. P3 Issues that are less important to the Flutter project platform-ios iOS applications specifically team-ios Owned by iOS platform team triaged-ios Triaged by iOS platform team
Projects
None yet
Development

No branches or pull requests

5 participants