You need to sign in to do that
Don't have an account?
Kevin Gutierrez
Modal size in lightning action
I created a lightning component which is a form for editing a related list on an object. I created a lightning action for the component in the object record details page in salesforce. My problem is that the modal the component shows in when the action is clicked has a small width, and the details for each list item become squished/truncated. Is there a solution/alternative for increasing the width of the modal the lighting component appears in?
- Force the quick action window to be wider, such as adding a div with a width of 600px as an example.
- Muck with the CSS or styles of the modal
For option 2, the SLDS modal has a div with a class "slds-modal__container". This class has the following CSS properties:- width: 50%
- max-width: 40rem;
- min-width: 20rem;
You can see this for yourself if you go to the modals page at www.lightningdesignsystem.com and open up the DOM inspector in your browser:If you add a css class or style to that container div and override the CSS, you should be able to make the modal presentable.
Salesforce provided option to customize the height of the pop up while creating an action button. But unfortunately there is no option for width.
I have tried multiple ways to increase the width but none of them is full proof. I have written a javascript code which is executed on component load and finds the html element with a specific class and increase the width by setting attribute, but this does'nt work in all case.
So for now there is no option to increase width of a popup.
But what you can do is, if your form is big enough then create one tab in record home page and add that component in the tab itself using lightning app builder.
Hope this helps..
Note - Kindly mark this answer as a best answer if this helped you, so that other's can also get benefit from it.
Thanks,
Mustafa Jhabuawala
Technical Lead at Zen4orce (http://www.zen4orce.com)
Hi Kevin,
There is very simple solution to your problem.
steps to increase your quick action width.
step1) Create css file and mention width according to your pop-up modal.Check below css code
and Add tis css file into your static resource. the more size you want more rem you can add.
Setp2) now include your css file into your lightning component.
Things to consider:
1) You cannot include this CSS in script tage as this is no more supported after spring'18.
2) Don't put this css into your component stylesheet file. (as in the case of this Std style sheet will override your css.)
Thanks select this answer as best if this solve your query.
Thanks,
DCool