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

Provide an option to auto-size height without affecting existing width #2732

Closed
2 tasks done
axefrog opened this issue Apr 4, 2022 · 6 comments
Closed
2 tasks done

Comments

@axefrog
Copy link

axefrog commented Apr 4, 2022

  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Is your feature request related to a problem? Please describe.
I frequently have text containers with at least a paragraph of text. I can't use autosize on these because it widens the box until the text fills the minimum height possible. In other words, autosize is prioritising width over height.

Describe the solution you'd like
I have two solutions I'd like to see. Either would be fine, but both would be ideal, as they would fit different scenarios.

  1. Provide a way to allow autosize to affect height but not width. There are two ways this could work:
    • An option to "lock" a single property value could be a useful feature in general. If applied to width, then the existing autosize feature could be used and would be able to see that it's not allowed to affect the width, and would thus prioritise changing the height, rather than the width.
    • Add an "autoheight" feature that is based on autosize, but does not affect width.
  2. Provide some kind of autolayout-like feature that allows autosize or autoheight to be continually applied whenever the content changes. This would be especially useful for lists, where sometimes the content of a list item requires extra height. Such a feature would avoid the need to manually resize list items and table cells every time the content changes.

Describe alternatives you've considered
There are no alternatives, other than manually resizing containers after editing their content.

Additional context
The following screenshot shows the use of a list and a free-floating text box. All items in the list have been manually sized to fit their content. The floating text box has not yet been manually sized (I created this issue first).

image

@mawid6
Copy link

mawid6 commented Jun 8, 2022

I have this need also, it would make text handling easier and more efficient.

Not an uncommon need, see for example here on stackexchange webapps or stackoverflow.

@alderg
Copy link
Contributor

alderg commented Jun 8, 2022

We'll add a fixedWidth property in the next release.

@alderg alderg closed this as completed Jun 8, 2022
@mawid6
Copy link

mawid6 commented Jun 10, 2022

@alderg: Playing aroun with fixedwidth and autosize, I noticed that (a) calculations seem to become a bit off when I set spacing/margins for the text and (b) when editing from empty (no text), it will briefly first let the text pan out, causing the view to shift sideways, and then calculate based on width and expand downwards.

Here is (b) behavior visually:

drawio-autosize-moves-view

@alderg
Copy link
Contributor

alderg commented Jun 13, 2022

We're unable to reproduce this. Which browser and OS is this, and what are the steps to reproduce this?

@chipbite
Copy link

chipbite commented Jun 13, 2022

Hi @alderg! Repro was quite simple, here are the steps (you can follow along visually in the animated gif screenrecording above):

  • Add shape, enter a long text. Set shape wordwrap, align to top. Set properties: Autosize and the new Fixed width. Now,
  • Remove all text to make it empty (cut will do). Now:
  • Paste all of the text again into the shape.

The result, as described in my previous message, is in the screenrecording visible above.

This is using windows 10 and chrome. I have not tested extensively, used any other browsers, etc. It happened consistently on Friday:
I did this on Friday, so whatever diagrams.net version was out then ;-) I have less time to try it today. :-)

@alderg
Copy link
Contributor

alderg commented Jun 13, 2022

Thanks for the report. This will be fixed in the next release.

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

No branches or pull requests

4 participants