mirror of
https://github.com/Dimillian/IceCubesApp.git
synced 2024-11-26 18:21:00 +00:00
Fix range jumping while editing text
This commit is contained in:
parent
1c8fabbe59
commit
b30b96c48d
1 changed files with 2 additions and 0 deletions
|
@ -43,9 +43,11 @@ public class StatusEditorViewModel: NSObject, ObservableObject {
|
||||||
|
|
||||||
@Published var statusText = NSMutableAttributedString(string: "") {
|
@Published var statusText = NSMutableAttributedString(string: "") {
|
||||||
didSet {
|
didSet {
|
||||||
|
let range = selectedRange
|
||||||
processText()
|
processText()
|
||||||
checkEmbed()
|
checkEmbed()
|
||||||
textView?.attributedText = statusText
|
textView?.attributedText = statusText
|
||||||
|
selectedRange = range
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue