singerdmx / flutter-quill

Rich text editor for Flutter
https://pub.dev/packages/flutter_quill
MIT License
2.6k stars 839 forks source link

[Android] Keyboard pops up briefly for a split second when opening a new page with QuillEditor that has content inside #2353

Open eldarj opened 2 weeks ago

eldarj commented 2 weeks ago

Is there an existing issue for this?

Flutter Quill version

10.8.5

Steps to reproduce

  1. Have a page ready that has quill.QuillEditor.basic 1.1. Initialize final quill.QuillController _controller = quill.QuillController.basic() 1.2. Initialize content with _controller = quill.Document.fromJson(jsonDecode(someJsonContent))
  2. Open this page from somewhere

When the page opens, for a very brief moment the keyboard is opened before closing. Seems like the editor gets focus for a split second

Expected results

When the page opens, keyboard is not opened at any point as long as autoFocus is set to false (which is by default) or it is fully opened and stays open if autoFocus is set to true

Actual results

When the page opens, keyboard is opened for a split second even if autoFocus is set to false (which is by default)

Additional Context

Code If you have the following ```console final quill.QuillController _controller = quill.QuillController.basic(); @override void initState() { super.initState(); _load(); } Future _load() async { // some code _controller.document = quill.Document.fromJson(jsonDecode(someJson)); // some code } @override Widget build(BuildContext context) { return Scaffold( // some code quill.QuillEditor.basic( controller: _controller, configurations: const QuillEditorConfigurations( placeholder: "Hint...", autoFocus: false ) // some code } ``` Even if autoFocus is set to false in the quill editor component (specifically configurations) - for some reason the keyboard is open for a brief moment when rendering the above
khlebobul commented 1 hour ago

I have exactly the same problem: maybe this one is due to a focus control conflict, but I haven't found a solution yet