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:
@@ -22,7 +22,11 @@ struct TextViewWrapper: UIViewRepresentable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func updateUIView(_ uiView: UITextView, context: Context) {
|
func updateUIView(_ uiView: UITextView, context: Context) {
|
||||||
|
let selectedRange = uiView.selectedRange
|
||||||
|
uiView.isScrollEnabled = false
|
||||||
uiView.attributedText = attributedText
|
uiView.attributedText = attributedText
|
||||||
|
uiView.selectedRange = selectedRange
|
||||||
|
uiView.isScrollEnabled = true
|
||||||
}
|
}
|
||||||
|
|
||||||
func makeCoordinator() -> Coordinator {
|
func makeCoordinator() -> Coordinator {
|
||||||
|
|||||||
Reference in New Issue
Block a user