3

I've added some if conditions in the below Modal example however when the content is rendered I'd need to scroll the Modal down. https://www.lightningdesignsystem.com/components/modals/

Is there a way to dynamically set the Modal height based on the content rendered?

2

I had similar problem. In my case it was a picklist with long list of options. slds-modal design specifications(here) says they have not done anything to accomodate content with a dynamic height and it would always add a scroll bar.

But but, there is a hack. which worked for me.

.slds-modal__content {
      overflow: visible;
      overflow-y: visible;
}

PS: I see this question was asked an year ago. I happen to come across while searching for solution. And I found one solution myself which I'm sharing

1
  • 1
    Works perfect Chetan. – Sudipta Deb Nov 11 '20 at 1:38
0

The modal height should adjust based on the content inside - the modal content block (.slds-modal__content) will begin to scroll when maximum height is reached.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.