Modal icon indicating copy to clipboard operation
Modal copied to clipboard

Issue applying classes

Open jcantrel opened this issue 4 years ago • 3 comments

I am trying to implement Blazored Modal into my Blazor server side app that uses Tailwind for CSS. However I am having trouble creating a form. No matter what CSS settings I've tried inside the component the modal itself remains the same size. I then tried applying a class to the modal itself seems to break. It becomes grayed out like the background and the elements inside cannot be interacted with.

No CSS modal-nocss

Any kind of CSS applied modal-css

Here is the code I am using, the specific CSS doesn't seem to matter. In this case the width does seem to change, but the modal element remains unclickable.

private void showModal() { var options = new ModalOptions() { Class = "w-1/4" }; Modal.Show<ViewPatient>("Add Patient", options); }

jcantrel avatar Dec 17 '21 15:12 jcantrel

When you provide a value for the Class option, it replaces the default class, they are not added to it. This is why are losing all other styling. You will need to provide all styling you require, including specifying a z-index so the modal shows above the backdrop.

chrissainty avatar Dec 18 '21 00:12 chrissainty

See #364 pending PR for some proposed updates to the docs clarifying this issue.

aterbo avatar Dec 23 '21 06:12 aterbo

Hopfully the updates docs provided by #364 should clarify what is required when specificying a custom class.

chrissainty avatar Dec 28 '21 18:12 chrissainty