question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot set dialog width or size

See original GitHub issue

I’m using the TinyMCE 5.0.1 Dialog UI component in a custom plugin. The docs don’t really mention how to set the dialog dimensions but from looking at the source code I’ve seen references to “width” and “size” properties; the former taking an integer and the latter a string such as “normal”.

However, I’ve set both of these properties with various values and neither seem to have an effect on the dialog size. It looks like the default size is hard coded as 480px max-width in the editor stylesheet and the dialog config can’t currently be used to override this. Or am I missing something?

For example, setting Dialog width in this way does nothing:

editor.windowManager.open({
  title: 'Test',
  width: 800,
  body: {
    type: 'panel',
    items: []
  },
  buttons: []
});

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
lofczcommented, Mar 23, 2020

I don’t agree with the solution by TinyMCE team in this case. Limiting developers liberty is generally frowned upon.

In order to set a custom size of your dialog:

editor.ui.registry.addButton { // or addMenuItem
    onAction: function() {
        setTimeout(function () {
            $(".tox-dialog__body-content").css("height", "400px"); // or width
        });
    }
}

TinyMCE will set the size of next opened dialog correctly so you can use this safely. As of version 1ac52053224165998fe49b7d5d2d6236fa7f94ab (5.2 / 5.3 dev)

3reactions
TheSpydercommented, Dec 12, 2019

Yeah, I get it, but this is the decision we made and instead we offer a fully customisable theme (hopefully we’ll release our theme builder soon which will make customising much easier).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't set properly my Dialog Window size and placement target
To solve my problems i removed the binding for width and height and simply added in the constructor of the DialogWindow
Read more >
Dialog | Dimensions | JET Developer Cookbook - Oracle
A dialog displays a popup window that provides information and gathers input from the application user. Dialog dimensions - width, height, min-width, ...
Read more >
How to Size and Position the MUI Dialog Component - Medium
Successfully set custom size and position for the Dialog ... any width or height passed to PaperProps sx value will affect the Dialog...
Read more >
EJ2 Grid Add/Edit Dialog size | ASP.NET Core - EJ 2 Forums
I am trying to change the height & width of the Add/Edit dialog in ... So in the normal window, we cannot set...
Read more >
How to Make an Alert Dialog Fill Majority of the Screen Size in ...
setting width to 90% of display. layoutParams.width = ( int ) (displayMetrics.widthPixels * 0 .9f);. // setting height to 90% of display.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found