Skip to content

Poor UX: cursor hidden behind soft keyboard on initial tap #2137

Open
@vishna

Description

@vishna

Is there an existing issue for this?

Flutter Quill version

10.4.0

iOS simulator, (and some low end Android device)

Steps to reproduce

  1. Open Flutter Quill Demo from the example folder
  2. Go to Text sample
  3. Tap the text somewhere on the bottom half of the screen, e.g. where Create a Bujo of Ledger is

Expected results

Keyboard appears and I can see the cursor where I tapped:

Actual results

Keyboard appears but the cursor is hidden behind the keyboard as the text scroll position did not adjust.

Tapping any key on the keyboard will make cursor visible again.

Code sample

No response

Additional Context

Workaround

Here's something I came up real quick to mitigate this issue

  • Listen to keyboard visibility changes
  • If keyboard becomes visible
    • wait around 300ms for things to settle 😬
    • call ensureCursorVisible extension method on the controller (this will re-trigger positioning):
extension QuillControllerInvisibleCursorFix on QuillController {
  void ensureCursorVisible() {
    if (selection.isCollapsed) {
      final position = selection.end;
      moveCursorToPosition(position);
    }
  }
}

Ideally this is handled by library, which should know cursor got pushed outside of viewport and react accordingly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    androidIssues or feature requests specific to the Android platform.bugSomething isn't workingiOSIssues or feature requests specific to the iOS platform.moderateIssues that are important for improving functionality or user experience.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions