seb-oss/ng-components

Size (lg, sm) for Modal doesn't work

Opened this issue · 3 comments

Describe the bug
When passing in the value for size (lg or sm) in Modal, , it has no effect.

Expected behavior
I expect the size of modal changes when I give the size lg or sm.

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: chrome
  • Version 91.0.4472.77 64-bits

Hello,
the size is working fine, you can check that on the demo URL: https://sebgroup.github.io/ng-components/docs/modal

image

image

image

I was having also having some issues sizing the modals. Turns out that it needed a min-width on the body element of the modal, if there is not any content there when initializing the component.

So, for example, if you're fetching all the content that goes inside the body of the modal, and there's nothing there when loading it, it will fall back to it's default size.

I solved it by giving the modal a min-width, something like this:

&__modal {
  @include media-breakpoint-up(md) {
    min-width: 24rem;
  }
}

I think it is the issue. By passing only the size (lg or sm) won't change the size of the modal, I put a div to stretch the modal to the size I want.