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

border-box and dialog resizing problem #1979

Closed
mcanepa opened this issue Sep 21, 2021 · 3 comments · Fixed by #2012
Closed

border-box and dialog resizing problem #1979

mcanepa opened this issue Sep 21, 2021 · 3 comments · Fixed by #2012

Comments

@mcanepa
Copy link
Contributor

mcanepa commented Sep 21, 2021

Having this CSS:

*
{
    box-sizing: border-box;
}

If you try to resize a dialog, then the inner content (ui-dialog-content) is resized wrongly

See this fiddle: http://jsfiddle.net/QBqff/2/

A workaround is suggested in https://bugs.jqueryui.com/ticket/9137

Using this CSS:

.ui-resizable, .ui-resizable * {
    box-sizing: content-box;
}

but that affects the size of several elements I have inside the dialog

@mcanepa
Copy link
Contributor Author

mcanepa commented Sep 22, 2021

apparently there is a pull request that addresses this issue but it was never accepted

#1451

@fnagel
Copy link
Member

fnagel commented Sep 24, 2021

Actually #1451 was never a valid PR (due to GIT and CLA issues). There was a follow up, this one: #1563 (which was never merged due to missing tests)

Having tests for that would be very nice, but we have almost no resources to work at jQuery UI at this point. Are you able to write some and create PR? Or at least rebase #1563 and add a new PR, confirming its still working?

@mcanepa
Copy link
Contributor Author

mcanepa commented Sep 29, 2021

Until this gets properly fixed, here's a workaround if anyone is looking for the same thing

$(selector).dialog({
    resize: function()
    {
        $(this).closest(".ui-dialog-content").css({
            "width": "100%",
            "height": "100%"
        });
    }
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment