Resize textView with text height
Hi @danielsaidi , I added this change so the text views in our application would resize according to the height of the contained text. I expect you would want this to be optional, but overall would you consider merging it to the main? I appreciate your project a lot and I think there's a good chance my coworkers and I will be contributing a lot to our fork, and I think it would be ideal if we could stay in sync with the core project as much as possible. Let me know your thoughts!
Thanks @slh-ideaflow for the PR. I was having some issues because the RichTextViewer was not adapting the heigth when placed in a List and these changes solve that.
I hope @danielsaidi can review it and merge into main
Hi guys,
Sorry for the late reply, I've been very busy with other projects.
Thank you so much for looking into this! It would be amazing, although as you say, the behavior should be opt-in.
I'll take a look at this and see if I can merge it and add configurations for it. 👍
I haven't forgotten this, but have been busy with other things.
It's on top of my todo list once the other critical things I'm focusing on are done.
@slh-ideaflow I've tried your solution for my view in a List. It works great at first glance, but if the RichTextEditor is redrawn after some time, it loses its size. For some reason, the textView size becomes zero for any consecutive draw. I'm not a master of the SwiftUI layout system, so maybe this is expected behavior. Anyway, I tried changing the code according to the solution from here, and now it works for my case.
@SubvertDev I finally got that implementation working for myself too. I'll add a comment there about an adjustment to it which I found helpful.
That's great! Feel free to share any findings here as well, for when I get around to it.
@slh-ideaflow Would merging this PR in its current state expose it to the flaw @SubvertDev mentioned?
@slh-ideaflow ?
I think we can close this -- the solution I landed on was here:
https://github.com/danielsaidi/RichTextKit/issues/33#issuecomment-2375315414
Perfect, thank you!