-
-
Notifications
You must be signed in to change notification settings - Fork 63
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
Support String Operations on Rich Text while retaining styles #70
Comments
It would be easier to accomplish after
User could build his own text field value from the current styles from annotated string available in rich text state and set it himself by taking out some styles / adding more styles And we could also provide helper methods that call |
I think that this a good idea, maybe also users want to remove an entire line or something like that. I'll check these options. At the same time I don't want to provide too much public Api's to the users didn't get confused. |
User can perform following operations on the text when its a string
These operations are easier because text is a string , you can perform all these operations easily because
String
is a perfect representation of theText
user wrote , But not in the case of Rich TextIf you want to remove a range of text , You know the indexes , startIndex & endIndex
The problem is retaining styles
I propose that the following methods be added to RichTextState and be exposed publicly
removeTextRange(startIndex : Int,endIndex : Int) : Boolean
replaceTextRange(startIndex : Int,endIndex : Int,replacement : AnnotatedString) : Boolean
addTextAtIndex(index : Int,text : AnnotatedString) : Boolean
When user calls these methods , text range is removed / replaced , or text is added at an index , Without affecting the styles of other text
The text was updated successfully, but these errors were encountered: