From 714681d99d3407bd5b42e7191b09d23feeb2df19 Mon Sep 17 00:00:00 2001 From: stefvanschie Date: Fri, 7 Feb 2020 20:40:08 +0100 Subject: [PATCH] Fix incorrect resizing of sidenav When the sidenav is in non-fixed mode and opened, then the window is maximized making the window wider than it was previously, the darkening effect of the sidenav would stay. This has now been changed. --- js/sidenav.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/js/sidenav.js b/js/sidenav.js index 4a88dd3901..3a0c06f084 100644 --- a/js/sidenav.js +++ b/js/sidenav.js @@ -358,10 +358,13 @@ _handleWindowResize() { // Only handle horizontal resizes if (this.lastWindowWidth !== window.innerWidth) { - if (window.innerWidth > 992) { - this.open(); - } else { + if (window.innerWidth <= 992) { + this.close(); + } + + if (window.innerWidth > 992 && this.lastWindowWidth <= 992) { this.close(); + this.open(); } }