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

Add support for autosizing the area based on its content #171

Closed
armin-bauer opened this issue Aug 26, 2015 · 2 comments
Closed

Add support for autosizing the area based on its content #171

armin-bauer opened this issue Aug 26, 2015 · 2 comments

Comments

@armin-bauer
Copy link

Hi,

it would be great if it was possible that the rich text edit automatically changes it's height, so that I can set a minimum and a maximum and the box just get's bigger as I enter text until the maximum is reached (could probably be done using maxHeight and minHeight). I'm trying to implement the feature myself for pull request but I didn't find out yet what would be the best way to do it since I've just recently started with JavaFX and don't know my way around everything yet.

If I'm missing something and this is already possible, please show me how.

Thanks.

@TomasMikula
Copy link
Member

Hi Armin,

this is not supported, because to compute the ideal height of the text area requires to layout the whole document, which would be costly for large documents (imagine thousands of paragraphs).

However, if maxHeight is given, it could be reasonable to try to compute the exact height, but once the intermediate value reaches the maxHeight limit, stop and return maxHeight.

If you want to give it a shot yourself, you need to start with Flowless, which is a component that RichTextFX uses to efficiently layout paragraphs (i.e. only layout visible paragraphs).

@JordanMartinez JordanMartinez changed the title Autosizing the RichTextEditor Add support for autosizing the area based on its content Mar 17, 2017
@Jugen Jugen mentioned this issue Aug 13, 2020
@Jugen
Copy link
Collaborator

Jugen commented Nov 5, 2020

Closed via PR 944

@Jugen Jugen closed this as completed Nov 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

4 participants