Skip to content

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

@SollyBunny

Description

@SollyBunny

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions