From 5558e96dddf08fbe02b1b54f8806a2300e480800 Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Tue, 17 Dec 2019 13:24:13 -0600 Subject: [PATCH 1/3] revert toggleOpen removal; clean up --- src/components/nav_drawer/nav_drawer.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/components/nav_drawer/nav_drawer.js b/src/components/nav_drawer/nav_drawer.js index 848d1fd8436..6a9e1aab88d 100644 --- a/src/components/nav_drawer/nav_drawer.js +++ b/src/components/nav_drawer/nav_drawer.js @@ -66,6 +66,20 @@ export class EuiNavDrawer extends Component { }); }; + toggleOpen = () => { + this.setState( + ({ isCollapsed }) => ({ + isCollapsed: !isCollapsed, + }), + () => { + this.setState(({ isCollapsed }) => ({ + outsideClickDisabled: isCollapsed ? true : false, + toolTipsEnabled: isCollapsed ? true : false, + })); + } + ); + }; + collapseButtonClick = () => { if (this.state.isCollapsed) { this.expandDrawer(); From 859f16a7273e930c6760e3e21f75fd7033334654 Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Tue, 17 Dec 2019 13:29:56 -0600 Subject: [PATCH 2/3] comment --- src/components/nav_drawer/nav_drawer.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/components/nav_drawer/nav_drawer.js b/src/components/nav_drawer/nav_drawer.js index 6a9e1aab88d..75e4d162796 100644 --- a/src/components/nav_drawer/nav_drawer.js +++ b/src/components/nav_drawer/nav_drawer.js @@ -66,6 +66,8 @@ export class EuiNavDrawer extends Component { }); }; + // Although not used in `src/`, this method is available to and used in `src-docs/` + // for imlementation-specific nav menu toggling via `ref` reference toggleOpen = () => { this.setState( ({ isCollapsed }) => ({ From 03875484e0673f2f9c8c5a8097a9f3b93a52eda4 Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Tue, 17 Dec 2019 13:33:05 -0600 Subject: [PATCH 3/3] CL --- CHANGELOG.md | 4 +++- src/components/nav_drawer/nav_drawer.js | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ff40217ca3..2ad1a94e42b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ ## [`master`](https://github.com/elastic/eui/tree/master) -No public interface changes since `17.2.1`. +**Bug fixes** + +- Reverted removal of `toggleOpen` method from `EuiNavDrawer` ([#2682](https://github.com/elastic/eui/pull/2682)) ## [`17.2.1`](https://github.com/elastic/eui/tree/v17.2.1) diff --git a/src/components/nav_drawer/nav_drawer.js b/src/components/nav_drawer/nav_drawer.js index 75e4d162796..33460718e8e 100644 --- a/src/components/nav_drawer/nav_drawer.js +++ b/src/components/nav_drawer/nav_drawer.js @@ -75,8 +75,8 @@ export class EuiNavDrawer extends Component { }), () => { this.setState(({ isCollapsed }) => ({ - outsideClickDisabled: isCollapsed ? true : false, - toolTipsEnabled: isCollapsed ? true : false, + outsideClickDisabled: isCollapsed, + toolTipsEnabled: isCollapsed, })); } );