Blazored / Modal

A powerful and customizable modal implementation for Blazor applications.
https://blazored.github.io/Modal/
MIT License
782 stars 185 forks source link

Wrap BlazoredModal.razor template in "if" statement #26

Closed AmarjeetBanwait closed 5 years ago

AmarjeetBanwait commented 5 years ago

In case of prerendering CloseIcon become visible momentarily. It will be nice if we wrap Modal Template in "if statement" only visible after show method calling.

chrissainty commented 5 years ago

Thanks for the suggestion @AmarjeetBanwait. I’ll have a look into this, also happy to accept a PR if you want to have a go?

AmarjeetBanwait commented 5 years ago

I think It will be enough to replace string.Empty with some hidden class in BlazoredModal.razor

Before <div class="blazored-modal-container @(IsVisible ? "blazored-modal-active" : string.Empty)"> After <div class="blazored-modal-container @(IsVisible ? "blazored-modal-active" : "blazored-modal-hidden")">

and in style.css

.blazored-modal-hidden{
display : none;
}

I didn't check it yet but hope it will work

chrissainty commented 5 years ago

Hi @AmarjeetBanwait, I’ve just been trying to replicate your issue. But the modal containers CSS is set too display: none by default. I also can’t seem to replicate the issue. Could you provide some repro steps?

AmarjeetBanwait commented 5 years ago

Hi @chrissainty, It seems working fine in Preview7.

However adding <link href="_content/Blazored.Modal/blazored-modal.css" rel="stylesheet" /> results in "Not Found" I tried it with 3 new projects but in all server is returning "Not Found" for this css.

So I am closing this issue for now. and will open new for Css Not Found issue.