From 8c021053a38d19bb7532a8d30b0e41885259f92b Mon Sep 17 00:00:00 2001 From: MattMo Date: Fri, 14 Apr 2023 08:05:40 -0700 Subject: [PATCH] Added auto close option to drawer. --- drawer.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drawer.js b/drawer.js index 3eb4793..5db46bb 100644 --- a/drawer.js +++ b/drawer.js @@ -134,6 +134,7 @@ class Drawer extends IgniteElement { this.update(); //If responsive is changed we must update. }), mobile: false, + autoClose: true, placement: "left", width: "20em", height: null, @@ -195,8 +196,16 @@ class Drawer extends IgniteElement { if (this.responsive) { if (window.innerWidth <= this.breakpoint && !this.mobile) { this.mobile = true; + + if (this.autoClose) { + this.show = false; + } } else if (window.innerWidth > this.breakpoint && this.mobile) { this.mobile = false; + + if (this.autoClose) { + this.show = true; + } } } }