0

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;">
  • anything relevant in the debugging console log? – stuartd Dec 08 '22 at 00:07
  • What is the _rendered_ javascript? – Joel Peltonen Dec 08 '22 at 12:35
  • @stuartd Nothing – StealthGhost Dec 08 '22 at 15:44
  • @JoelPeltonen I added the rendered Javascript to my post – StealthGhost Dec 08 '22 at 15:44
  • ` $.get("/Controller/Method/" + id,` this cant be correct, unless you're obfuscating the controller class name and method name for some reason. – d0rf47 Dec 08 '22 at 17:37
  • @d0rf47 I am obfuscating it. Force of habit. – StealthGhost Dec 08 '22 at 18:05
  • Hm. Extremely weird. Could it be an outright bug in chrome? Someone else reported weird behavior as well https://stackoverflow.com/questions/48457560/strange-behavior-of-the-column-count-property-in-chrome – Joel Peltonen Dec 08 '22 at 19:11
  • Kinda in any case sounds like it's a purely frontend/browser thing – Joel Peltonen Dec 08 '22 at 19:12
  • @JoelPeltonen It does feel like either a bug in Chrome or some functionality that was deprecated in Chrome 108. We primarily use Chrome and this code has been in production for a few months with no issues until Chrome 108. – StealthGhost Dec 08 '22 at 19:50
  • We were recently notified by a client affected by this same issue, which I recently tracked down to the `column-count` property. This is now broken in Chrome 108 when the site went live in February of this year and has been running without issues. Replacing this with `display: flex` to achieve the column effect works, but unfortunately with the items in a different order which isn't ideal. I've opened a Chromium issue here: https://bugs.chromium.org/p/chromium/issues/detail?id=1400279 – jrrdnx Dec 12 '22 at 16:03
  • @jrrdnx Thanks, glad it's not just me. I'll keep an eye on the issue you created! – StealthGhost Dec 12 '22 at 20:50
  • @jrrdnx Are you still seeing the issue? I just tried it again on 108 and I'm not seeing it anymore. Not sure if they made a change. Version 108.0.5359.125 (Official Build) (64-bit) – StealthGhost Dec 19 '22 at 23:07
  • @StealthGhost Confirmed the old column-count code that I was seeing with this issue in 108.0.5359.98 is now working for me in 108.0.5359.124. – jrrdnx Dec 23 '22 at 15:55

0 Answers0