Fix cursor jumping around after pressing return

Changelog-Fixed: Fix cursor jumping around after pressing return
Fixes: #728, #747
Closes: #742
This commit is contained in:
gladius
2023-03-06 03:31:38 -05:00
committed by William Casarin
parent 18449c8c0d
commit dd511c3061

View File

@@ -22,7 +22,11 @@ struct TextViewWrapper: UIViewRepresentable {
}
func updateUIView(_ uiView: UITextView, context: Context) {
let selectedRange = uiView.selectedRange
uiView.isScrollEnabled = false
uiView.attributedText = attributedText
uiView.selectedRange = selectedRange
uiView.isScrollEnabled = true
}
func makeCoordinator() -> Coordinator {