Modal width
Question
Hello, is there a way to set a modal's width, its currently set to 850px by CSS, but I would like to create a dialog with a small amount of text and its too big for this:

But it would be great to get this:

Without overriding the CSS, because I would still like to use large modals.
I checked the source code and the docs, it seems the only properties you can set are title and content.
Answers (3)
For those who don't know how to use modal attributes.
You can add option opts.attributes to modal's open method as below.
const modal = editor.Modal;
const opts = {
attributes: { class:'my-custom-class', id:'my-custom-id' }
}
modal.open(opts);
Because I didn't find how to use it in the documentation here.
OK, what I'm thinking is to create a function to be able to set the width like: setWidth('400px'), and also a method to set custom attributes: setAttributes({'data-custom-attribute': 123}).
I think 2 functions are needed because the width is controlled by CSS, and so is the modal's design, so just letting the user set the width is good enough in this case. The attribute function would be for any other case that's needed
What do you think?
Hello, sorry I'm piled with work now, if @sunnykgupta can give this a shot it would be great.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #2364
[Question] How to add toolbar functionality to the layers panel.
I am trying to add the toolbar to the layers panel and I am not sure how to go about this. Is there any way to accomplish this? toolbar Whe...
Issue #2002
Images won't resize to full width
When an image is resized with the mouse, it won't stretch all the way to the edge of the canvas, leaving a white space on the right side. I...
Issue #1368
Resize canvas
Is there a way to have a dynamic resizing of the canvas? i.e not using the Device Manager, but having a drag and drop of the width, similar...
Issue #1791
Name of the destination
@artf, Is there any way to show the name of the destination element ?
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.