diff --git a/Tusker/Screens/Compose/MainComposeTextView.swift b/Tusker/Screens/Compose/MainComposeTextView.swift index 3092b7c8..6d0ba707 100644 --- a/Tusker/Screens/Compose/MainComposeTextView.swift +++ b/Tusker/Screens/Compose/MainComposeTextView.swift @@ -211,9 +211,10 @@ struct MainComposeWrappedTextView: UIViewRepresentable { let cursorRect = textView.caretRect(for: range.start) var rectToMakeVisible = textView.convert(cursorRect, to: scrollView) - // move Y position of the rect that will be made visible down by the cursor's height so that there's + // expand the rect to be three times the cursor height centered on the cursor so that there's // some space between the bottom of the line of text being edited and the top of the keyboard - rectToMakeVisible.origin.y += cursorRect.height + rectToMakeVisible.origin.y -= cursorRect.height + rectToMakeVisible.size.height *= 3 let animator = UIViewPropertyAnimator(duration: 0.1, curve: .linear) { scrollView.scrollRectToVisible(rectToMakeVisible, animated: false)