Skip to content

Commit

Permalink
Adds/Fixes: 412
Browse files Browse the repository at this point in the history
  • Loading branch information
jbomhold3 committed Dec 7, 2020
1 parent 4346bc1 commit ccf6206
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/BlazorStrap/wwwroot/blazorStrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,13 @@ window.blazorStrap = {
if (!document.body.classList.contains("modal-open")) {
document.body.classList.add("modal-open");
}
this.paddingRight("17px");
var body = document.body,
html = document.documentElement;
var height = Math.max(body.scrollHeight, body.offsetHeight,
html.clientHeight, html.scrollHeight, html.offsetHeight);
if (height > window.innerHeight) {
this.paddingRight("17px");
}
return id;
},
close: function (id) {
Expand Down
16 changes: 16 additions & 0 deletions src/SampleCore/Pages/Samples/Issue412.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@page "/samples/issue412"
<div class="docs-example">
<BSButton Color="Color.Primary" @onclick="@(() => LiveDemo.Show())">Launch demo modal</BSButton>
<BSModal @ref="LiveDemo">
<BSModalHeader OnClick="@(() => LiveDemo.Hide())">Modal title</BSModalHeader>
<BSModalBody><p>Modal body text goes here.</p></BSModalBody>
<BSModalFooter>
<BSButton Color="Color.Secondary" @onclick="@(() => LiveDemo.Hide())">Close</BSButton>
<BSButton Color="Color.Primary" @onclick="@(() => LiveDemo.Hide())">Save Changes</BSButton>
</BSModalFooter>
</BSModal>
</div>

@code {
BSModal LiveDemo { get; set; }
}

0 comments on commit ccf6206

Please sign in to comment.