Skip to content

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

Open
@eldarj

Description

@eldarj

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
  final quill.QuillController _controller = quill.QuillController.basic();

  @override
  void initState() {
    super.initState();
    _load();
  }
  
  Future<void> _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

Metadata

Metadata

Assignees

No one assigned

    Labels

    androidIssues or feature requests specific to the Android platform.bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions