format code
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
import SwiftUI
|
||||
|
||||
struct NoteTextEditor: View {
|
||||
@Binding var text: String
|
||||
let remoteText: String?
|
||||
@State private var selection: TextSelection? = nil
|
||||
|
||||
var body: some View {
|
||||
TextEditor(text: $text, selection: $selection)
|
||||
.onChange(of: remoteText) { oldValue, newValue in
|
||||
guard let newValue, newValue != text else { return }
|
||||
// Apply remote text first
|
||||
text = newValue
|
||||
}
|
||||
}
|
||||
@Binding var text: String
|
||||
let remoteText: String?
|
||||
@State private var selection: TextSelection? = nil
|
||||
|
||||
var body: some View {
|
||||
TextEditor(text: $text, selection: $selection)
|
||||
.onChange(of: remoteText) { oldValue, newValue in
|
||||
guard let newValue, newValue != text else { return }
|
||||
// Apply remote text first
|
||||
text = newValue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user