function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Lena RLena R 

How to get rid of scroll bar in modal popup

I'm using force:lightningQuickActionWithoutHeader in my aura:component. I'm not sure why the modal popup comes up with a vertical scrolling bar and I need to scroll down to see the buttons. How do I get rid of it? Thank you

scroll bar

 
NagendraNagendra (Salesforce Developers) 
Hi Lena,

May I suggest you please give a try with sample code below.
var widht = $('body').width();
$('body').css('overflow', 'hidden')
var scrollWidth = $('body').width() - width;

$('body').css('margin-right', scrollWidth + 'px')
Please let us know if this helps.

Regards,
Nagendra.
 
Lena RLena R
Hi Nagendra, thank you for your response.

Unfortunately, your suggestion didn't help. The issue is with the height of the popup, not the width.

First of all, I'd like to add to my previous description that the issue happens in the desktop view, not mobile.

What I noticed when inspecting the code after the popup loads that the height and the max-height on the modal-body element is set to 250px. I think this is what's causing the vertical scroll bar to appear. Is there a formula to dynamically calculate the required height for the modal-body element and override the 250px value?

Would there be any other suggestions please?

scroll bar