-
-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
allows for monitoring textViewSouldChangeTextInRange #167
base: main
Are you sure you want to change the base?
allows for monitoring textViewSouldChangeTextInRange #167
Conversation
what is an appropriate use for this? I currently react to changes in RichTextEditor using |
In SwiftUI on iOS 17 we can also use .onKeyPress, ex:
While this worked on simulator, I had trouble getting it to function on a real iOS 17 device. I decided that a native solution that has worked solidly for years would be the quickest approach, thus this PR. |
I'd love to use .onKeyPress. As discussed here, under MacOS, that is never called in my app |
@GabeRoze Interesting use case as I want to do the same thing but with a list of todos... Any guidelines for that? |
@S1D1T1 @GabeRoze @martindufort Not currently, unfortunately. I'm also swamped with work atm, and am not really sure when I will have time to return to this project for more complex features. |
@GabeRoze After reviewing this, I think using SwiftUI to monitor is the way to go, rather than to inject these kinds of things. |
SwifTUI RichTextEditor now includes ability to monitor text changes from shouldChangeTextInRange delegate.