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

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

Open
RickoNoNo3 opened this issue Jan 1, 2023 · 2 comments
Assignees

Comments

@RickoNoNo3
Copy link

RickoNoNo3 commented Jan 1, 2023

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
Copy link

theisof commented Jun 5, 2023

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
Copy link
Contributor

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.

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

No branches or pull requests

3 participants