fleather icon indicating copy to clipboard operation
fleather copied to clipboard

Auto-scroll not working when inserting text programmatically without keyboard focus

Open anneinge95 opened this issue 3 months ago • 1 comments

Auto-scroll feature does not work when text is inserted programmatically (e.g., via speech-to-text) while the keyboard is hidden. The cursor/newly inserted text goes out of view and the editor doesn't scroll to keep it visible.

Expected Behavior

When text is inserted using controller.replaceText() with a selection parameter, the editor should automatically scroll to keep the cursor visible, similar to how it works when user is typing with keyboard.

Current Behavior

Text is inserted correctly at the cursor position The selection is updated to the new position BUT: The editor does not scroll to show the new cursor position This causes the cursor to disappear below the visible viewport

Environment

Flutter version: [3.35.5] Fleather version: directly to master branch Platform: iOS and Android

Steps to Reproduce

Steps to Reproduce

  1. Create a FleatherEditor with scrollable: true
  2. Add enough content so the editor becomes scrollable
  3. Hide the keyboard
  4. Programmatically insert text
  5. Observe that the text is inserted but the editor doesn't scroll to show it

Use Case This is critical for implementing speech-to-text functionality where:

User activates speech recognition via a bottom sheet Keyboard must be hidden to show the speech UI Text is continuously inserted as user speaks Editor should auto-scroll to keep the cursor visible above the bottom sheet

anneinge95 avatar Oct 09 '25 11:10 anneinge95

Could you provide a minimal sample code to reproduce the issue? @anneinge95

Amir-P avatar Oct 09 '25 14:10 Amir-P

Closing as stale. Feel free to re-opon

amantoux avatar Dec 11 '25 07:12 amantoux