From 031bac98633a8f913eb1902c00de8decc8ac16b9 Mon Sep 17 00:00:00 2001 From: Mattermost Build Date: Tue, 18 Aug 2020 18:23:11 -0400 Subject: [PATCH] Allow swipe to close the sidebar after search is cancelled (#4688) (#4697) (cherry picked from commit 033cdfc459979e677460f2780989dc461a01652d) Co-authored-by: Elias Nahum --- app/components/sidebars/main/main_sidebar.ios.js | 2 +- app/components/sidebars/main/main_sidebar_base.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/components/sidebars/main/main_sidebar.ios.js b/app/components/sidebars/main/main_sidebar.ios.js index 0e9be4762..26a49f99b 100644 --- a/app/components/sidebars/main/main_sidebar.ios.js +++ b/app/components/sidebars/main/main_sidebar.ios.js @@ -50,7 +50,7 @@ export default class MainSidebarIOS extends MainSidebarBase { if (this.state.drawerOpened && this.drawerRef?.current) { this.drawerRef.current.closeDrawer(); } else if (this.drawerSwiper && DeviceTypes.IS_TABLET) { - this.resetDrawer(true); + this.resetDrawer(); } }; diff --git a/app/components/sidebars/main/main_sidebar_base.js b/app/components/sidebars/main/main_sidebar_base.js index 40d675170..ab95f0669 100644 --- a/app/components/sidebars/main/main_sidebar_base.js +++ b/app/components/sidebars/main/main_sidebar_base.js @@ -156,6 +156,9 @@ export default class MainSidebarBase extends Component { onSearchEnds = () => { this.setState({searching: false}); + if (this.drawerRef?.current) { + this.drawerRef.current.canClose = true; + } }; onSearchStart = () => {