With the latest Chrome/Edge update (108) my page now hangs instead of showing the data in the modal. I get a unresponsive error and it never resolves. Sometimes the modal footer shows but never the data. If I downgrade my Chrome version it resolves the issue. Am I doing something wrong here that I can correct?
Modal on the main page:
<div class="modal-content">
<div class="modal-body" style="column-count: 3; column-width: 100px; margin: auto">
</div>
<div class="modal-footer">
<input type="submit" name="Save" class="btn btn-success" value="Save" />
<button type="button" class="btn btn-danger" data-dismiss="modal">Close</button>
</div>
</div>
Controller:
[HttpGet]
public async Task<ActionResult> DocumentTypes(int id)
{
//Code to populate the model
return PartialView("_DocumentTypes", model);
}
Javascript:
function documentTypeSelect(id) {
$.get("@Url.Action("Method", "Controller")/" + id,
function (data) {
$('.modal-body').html(data);
});
$("#documentTypeModel").modal("show");
}
Button that fires the Javascript:
<a class="btn btn-default btn-sm" style="white-space: normal; text-align: left" id="@item.Id" onclick="documentTypeSelect(this.id)">
@Html.DisplayFor(model => item.DocuType)
</a>
Edit:
Rendered Javascript:
function documentTypeSelect(id) {
$.get("/Controller/Method/" + id,
function (data) {
$('.modal-body').html(data);
});
$("#documentTypeModel").modal("show");
}
If I comment out the following code in my Javascript the modal shows and there is no unresponsive error, but obviously the data in the modal-body doesn't show.
$('.modal-body').html(data);
PartialView where I am rendering the list I created in the controller:
@for (var i = 0; i < Model.DocumentTypeList.Count(); i++)
{
<div class="row row-eq-height">
<div class="form-group col-md">
<div class="row row-eq-height border-bottom">
<div class="col-md-10">
@Html.DisplayFor(m => m.DocumentTypeList[i].Display, new { @class = "control-label" })
</div>
<div class="col-md-2">
@Html.CheckBoxFor(m => m.DocumentTypeList[i].Status, new { @class = "form-control" })
@Html.HiddenFor(m => m.DocumentTypeList[i].Display)
@Html.HiddenFor(m => m.DocumentTypeList[i].Code)
</div>
</div>
</div>
</div>
}
Edit 2:
If I remove this styling then the modal displays without Chrome hanging.
<div class="modal-body" style="column-count: 3; column-width: 100px; margin: auto">
Edit 3:
If I only remove margin: auto, then it works as well...like so:
<div class="modal-body" style="column-count: 3; column-width: 100px;">