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

New Modal window stretch if a single line text edit inside has lot of chars #5737

Open
itsNiccoloSabatini opened this issue Feb 21, 2025 · 3 comments
Labels
bug Something is broken

Comments

@itsNiccoloSabatini
Copy link

Bug description
if inside the new Modal window there is a TextEdit::singleline with more char than the length of the Modal it will grow to "contain" the text, but is kinda awkward in fact once it grows it can't go back to normal size.

To Reproduce
Steps to reproduce the behavior:

  1. open a modal that has inside a TextEdit::singleline.
  2. write inside the TextEdit until the window starts to grow and reach the end of the screen.
  3. select all the content of the TextEdit and erase it's gonna stay the same enlarged length.

Expected behavior
The expected behavior should be that the Modal window won't grow to follow the text inside the textbox, it could also be a good idea to implement max_width and max_length (to set a max size for modal windows) and a fixed_width and fixed_length (to fix the size of a modal window) for Area of Modal.

Screenshots
Image

Desktop (please complete the following information):

  • OS: NixOs (24.11 last channel)
  • Browser: Firefox
  • Version: 135.0.1 (64-bit)
@itsNiccoloSabatini itsNiccoloSabatini added the bug Something is broken label Feb 21, 2025
@saturn77
Copy link

Suggest taking a look at hydra's egui_tabbed example, where he used taffy to solve this issue per my understanding:

https://github.com/hydra/egui-tabbed-document-ui-example

@hydra
Copy link

hydra commented Feb 25, 2025

I agree with @itsNiccoloSabatini that it's a bug and shouldn't resize in the way it does. My issue was primarily focussed on having the text entry box resize with it's parent container, and I was able to solve that with taffy:

My workaround was here, but obviously involves using egui_taffy: https://github.com/hydra/egui-tabbed-document-ui-example/blob/073d94ee85ea9efa0c92cf9a713986122075bb6f/src/app/app_tabs/new.rs#L162-L181

@lucasmerlin
Copy link
Collaborator

lucasmerlin commented Feb 25, 2025

Pretty sure this should be solved by #5640, can you try using egui from that branch to see if that fixes it?

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

No branches or pull requests

4 participants