Skip to content
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

Resize textView with text height #189

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

slh-ideaflow
Copy link

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!

@slh-ideaflow slh-ideaflow marked this pull request as ready for review August 15, 2024 04:08
@robjperez
Copy link

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

@danielsaidi
Copy link
Owner

danielsaidi commented Aug 22, 2024

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. 👍

@danielsaidi
Copy link
Owner

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.

@SubvertDev
Copy link

@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.

@slh-ideaflow
Copy link
Author

@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.

@danielsaidi
Copy link
Owner

That's great! Feel free to share any findings here as well, for when I get around to it.

@danielsaidi
Copy link
Owner

@slh-ideaflow Would merging this PR in its current state expose it to the flaw @SubvertDev mentioned?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants