Intercooler.js Bug: Body Overflow Hidden Toggled on New Page Load

Ran into a little bug here tonight playing around with Intercooler.js. At the moment I’m converting my traditional web-app, MoneyPhone, into a single page application using Intercooler.js. However, whenever I attempt to swap out one page with another using Intercooler.js, somehow all of the page overflow is becoming hidden. I’ve poured over my code and can’t find anything related to ‘body overflow hidden’, but did see in the developer console that the style property overflow is indeed being set to hidden whenever a new page is loaded in the background with Intercooler.js.

So I just wanted to post a quick little bug fix here on the blog in case anyone else out there on the ole interwebs runs into this problem in the future:

$(document).on('success.ic', function(event, ajaxSetup, elt){
  document.getElementById("body").style.overflow = 'visible';
});

 

topherPedersen