t4t5 / sweetalert

A beautiful replacement for JavaScript's "alert"
https://sweetalert.js.org
MIT License
22.4k stars 2.84k forks source link

customizing height is not working. max-height / height not working as expected #887

Closed Femina closed 5 years ago

Femina commented 5 years ago

I am trying to load some long documents using sweer alert modal but it's cutting off partially instead of loading them with the scroll.

.swal-custom-style{ width:60% !important; height:60% !important; overflow: scroll; }

I even tried with suggested solutions still it is loading partially. ( half of the doc but not full ). Do we have any limitation of contents? If I keep height auto it works.

t4t5 commented 5 years ago

Please provide a JSFiddle or something that's easily testable.

Femina commented 5 years ago

https://codepen.io/femina-the-decoder/pen/dayWzW Exactly this is the issue. why it truncates file content partially? Or Am I something missing?

t4t5 commented 5 years ago

Since the Sweetalert's default CSS is loaded after your custom CSS, and they both just specify a single class in this example, it will overrule some of the styles.

You could fix it with something like this:

.swal-custom-style {
    overflow: scroll !important;
}

or by using a more specific class like .sweet-alert.swal-custom-style in your CSS.