danielsaidi / RichTextKit

RichTextKit is a Swift SDK that helps you use rich text in Swift and SwiftUI.
MIT License
950 stars 126 forks source link

Newlines not being indenting until adding additional text #61

Open DavidAlvarezDev opened 1 year ago

DavidAlvarezDev commented 1 year ago

Hello,

Thanks for your great work, I just started a project this Friday, and you package has beet a huge help!

One problem that I have not been able to solve it to see the cursor indent after hitting enter on the keyboard (new line). The indent works fine if there is no next in the text editor field. It this seems like a bug to me, because the user would have to start typing on that new line before he sees the cursor indent.

I apologize if it is error on my part, but I can't find a workaround.

Thanks in advance,

David Alvarez info@davidalvarezdev.com

danielsaidi commented 1 year ago

Hi @DavidAlvarezDev

Happy to hear that the library has helped you out :)

The rich text editor is just a thin wrapper over the native UITextView and NSTextView. Do you see the same issue when using those views?

DavidAlvarezDev commented 1 year ago

Yes Daniel, thank you very much!

I think I have noticed a pattern in issues I am having. Even though the context is updated, the AttributedString is not changed until the user actually inputs text. So changing the context, has no immediate affect on the AttributedString.

I noticed this fact when getting the font from the context. Even though the context is set to a specific font size, the AttributedString does not get this attribute added until characters are entered.

And to answer your question, no, I have not used UITextView directly before.

danielsaidi commented 1 year ago

Ok, great info - thanks! I will look into it :)