diff --git a/assets/css/beautifuljekyll.css b/assets/css/beautifuljekyll.css index 5bcc5da..4e809c4 100644 --- a/assets/css/beautifuljekyll.css +++ b/assets/css/beautifuljekyll.css @@ -1067,6 +1067,8 @@ pre { margin-top: 1.5rem; color: #fff; font-size: 1.5rem; + max-height: calc(100vh - 6.5rem); + overflow-y: auto; } #search-results-container a { color: #fff; diff --git a/assets/js/beautifuljekyll.js b/assets/js/beautifuljekyll.js index 48a3ada..4a7ab7f 100644 --- a/assets/js/beautifuljekyll.js +++ b/assets/js/beautifuljekyll.js @@ -121,13 +121,18 @@ var BeautifulJekyllJS = { e.preventDefault(); $("#beautifuljekyll-search-overlay").show(); $("#nav-search-input").focus().select(); + $("body").addClass("overflow-hidden"); }); $("#nav-search-exit").click(function(e) { e.preventDefault(); $("#beautifuljekyll-search-overlay").hide(); + $("body").removeClass("overflow-hidden"); }); $(document).on('keyup', function(e) { - if (e.key == "Escape") $("#beautifuljekyll-search-overlay").hide(); + if (e.key == "Escape") { + $("#beautifuljekyll-search-overlay").hide(); + $("body").removeClass("overflow-hidden"); + } }); } };