FleatherField cursor does not stay visible when focused
When the cursor moves outside of the view (or behind the keyboard), the parent scrollable should scroll so that the cursor stays in view, the same way that TextFormField does.
Steps to Reproduce
- Add a FleatherField to a ListView, with plenty of empty space above and below the field to scroll.
- Type in the FleatherField until the cursor disappears beneath the keyboard
Environment
- OS: iOS/Web/Android
- Flutter version: 3.24
- Fleather version: 1.18.0
@kane-knowby I managed to reproduce
The thing here is that the scroll controller of the parent widget should not be controlled by the FleatherField as it depends on the position of FleatherField within the parent viewport.
You can try repositioning the parent scroll controller as the field grows.
Closing as stale for some time Feel free to re-open
Hi. I also want to give you master devs @Amir-P @amantoux some well deserved props because this package is amazing from where you took it and very sufficient for my use case. I also am having the same scrolling to the viewport issue with cursor going below the keyboard.
I did some research into the matter and it seems a similar issue was reported on the original repo project zefyr. https://github.com/flutter/flutter/issues/10826
From the thread, there is some proposed solution with considering the offset with and without the keyboard, but I believe this is for pack flutter_quill.
Here is the implemented solution code.
I tried testing and debugging my own implementation (Container,Column, SingleChildScrollView,Scaffold different parent child code, expanded and/or scrollable as true/false, set and not setting maxHeight), but got the same result of a non scrolling past the scroll container but also not scrolling the cursor above the keyboard. I can leave code snippet, but if you wrap FleatherFieldin a Listview and then wrap listview in a Container is what the code would in essence be with other children in the listview as well.
For future reference https://github.com/fleather-editor/fleather/issues/438.