commit dd511c30614b687caf479ff57c8be49de011fdac
parent 18449c8c0da58021146b2ba73ee063d45346dac4
Author: gladius <garthsnyder@protonmail.com>
Date: Mon, 6 Mar 2023 03:31:38 -0500
Fix cursor jumping around after pressing return
Changelog-Fixed: Fix cursor jumping around after pressing return
Fixes: #728, #747
Closes: #742
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/damus/Views/TextViewWrapper.swift b/damus/Views/TextViewWrapper.swift
@@ -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 {