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

Autosize for winbox's content ~~Autosize doesn't appear to work~~ #172

Open
SollyBunny opened this issue Jan 1, 2024 · 0 comments
Open

Comments

@SollyBunny
Copy link

SollyBunny commented Jan 1, 2024

Code

WinBox({
	title: "Autosize Test",
	x: "center", y: "center",
	maxwidth: 500, maxheight: 500,
	max: false, overflow: true, 
	autosize: true,
	html: `<div style="width:100px;height:100px;border:1px solid black">Hello World!</div>`
})

Expected Behaviour

The window spawns in the center with width 100px, height 100px as that's the size of the content (html)

Actual Behaviour

Window spawns as if autosize isn't there with width 500px, height 500px

Tested on Demo Site

image

Tested with latest release

image

Oops

autosize: Automatically size the window to fit the window contents.

I have misread and window refers to the viewport and not the winbox window. This is now a feature request, it's very hard to resize the window given the content of it as you need to spawn the window to know the size of it's content

I've tried:

oncreate: opts => {
 	opts.width = container.clientWidth;
	opts.height = container.clientHeight;
}

(client[Width|Height] is unknown until added to DOM)

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

1 participant