nextapps-de / winbox

WinBox is a modern HTML5 window manager for the web: lightweight, outstanding performance, no dependencies, fully customizable, open source!
Apache License 2.0
6.23k stars 201 forks source link

The default value of `maxwidth` / `maxheight` can be set to a very large number rather than the size of viewport #151

Open RickoNoNo3 opened 1 year ago

RickoNoNo3 commented 1 year ago

in v0.2.6, a winbox without special configurations will take the calculation results of the viewport as maxwidth and maxheight attributes. We assume that its size is unlimited and is just supposed to stay in the viewport. But when the browser is resized(especially enlarged), these two attributes can not be updated automatically, and will cause bugs--the winbox will have an unexpected size limit--the size of the old viewport.

After my test, it works well to assign a very large number that is larger than any browser's size by default to these attributes. In such situation, the size of winbox is still limited within the area we agreed because of the top/right/bottom/left limiting mechanism. And it can perfectly solve the above problem.

theisof commented 1 year ago

Thanks, I had the same issue.

As you describe, setting a large value for maxwidth and maxheight seems to solve the issue:

{
  maxwidth: 10000000000000,
  maxheight: 10000000000000,
}

The issue can actually be reproduced from the demo webpage https://nextapps-de.github.io/winbox/

  1. Press the "Show example" button
  2. Resize the browser window to make it larger
  3. Try to resize the winbox into the newly available space
  4. The winbox will be restricted by the initial size of the brower window
ts-thomas commented 1 year ago

Thanks for the report. This workaround doesn't solve the issue when browser window size is reduced. I will add autoscale support to the next version.