You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use the library in SwiftUI and followed the example exactly. However, I am facing an issue where, when I update the attributedText from a button action like this:
ProtonView(attributedText: $att, selectedRange: $selectedRange)
Button("Button") {
att = att.addingAttributes([.foregroundColor: UIColor.red], to: selectedRange)
}
The attributedText in the EditorView doesn't update as expected. The changes made to the att (such as adding attributes to the text) don't reflect in the EditorView.
In ProtonWrapperView, if I use the following code to update the EditorView:
I am trying to use the library in SwiftUI and followed the example exactly. However, I am facing an issue where, when I update the attributedText from a button action like this:
The attributedText in the EditorView doesn't update as expected. The changes made to the att (such as adding attributes to the text) don't reflect in the EditorView.
In ProtonWrapperView, if I use the following code to update the EditorView:
The attributedText updates as expected, but I receive the warning:
Modifying state during view update, this will cause undefined behavior.
Can anyone help me figure out how to correctly update attributedText in the EditorView so that changes are reflected?
The text was updated successfully, but these errors were encountered: