mustang-im / mustang

Mustang - New full-featured desktop email, chat and video conference client
https://mustang.im
Other
8 stars 1 forks source link

Chat viewer: iframe sized to content #141

Open benbucksch opened 1 month ago

benbucksch commented 1 month ago

Reproduction

Actual result

Expected result

Cause

jermy-c commented 1 month ago

Progress Update

  1. Messages are loaded in <webview/> using the Shared/WebView Component
  2. The height it sized to to the height of the content except when the content is minimal because there's min-height for the iframe within the . I'm still not sure how to set the min-height for the iframe that is within the webview. The min-height is 126px. 圖片 圖片
jermy-c commented 3 weeks ago

183

Known Issues:

Tried:

TODO

benbucksch commented 3 weeks ago

Make the webview tag have a max-width of it's parent

Try to set the max-width at the start, before rendering, i.e. at the same time when we set the content, not in the resize handler.

Normal (non-hvbox-flex-grid) layout works by first determining the width, then the layout including line wraps happens, and then the height is a result of the content height. Without knowing the width, the browser doesn't know where to wrap lines and therefore doesn't know how many text lines there are and therefore cannot know the know the height. That's why the width needs to be set, before the height can be determined.