always place cursor at end of file when switching to edit mode
Removes the unreliable viewport-centre cursor heuristic. Switching to edit mode now always positions the cursor at text.length and scrolls to the bottom, whether arriving from a regular tap or a long-press. The long-press scroll-to-end on initial load (view mode) is unchanged. Cleans up _cursorAtEnd flag, _editorKey / GlobalKey, _getOffsetAtViewportCenter, and the public WrappedCodeFieldState / findRenderEditable that were only needed for the removed feature. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
db13702e54
commit
14d6b3c44d
2 changed files with 15 additions and 20 deletions
|
|
@ -43,7 +43,9 @@ class _WrappedCodeFieldState extends State<WrappedCodeField> {
|
|||
|
||||
@override
|
||||
void dispose() {
|
||||
_focusNode.dispose();
|
||||
if (widget.focusNode == null) {
|
||||
_focusNode.dispose();
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue