Skip to content

Commit

Permalink
Revert EuiNavDrawer toggleOpen removal (#2682)
Browse files Browse the repository at this point in the history
* revert toggleOpen removal; clean up

* comment

* CL
  • Loading branch information
thompsongl committed Dec 17, 2019
1 parent e811631 commit 0363814
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

- Converted `EuiHighlight` to Typescript ([#2681](https://github.com/elastic/eui/pull/2681))

**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)

**Bug fixes**
Expand Down
16 changes: 16 additions & 0 deletions src/components/nav_drawer/nav_drawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,22 @@ export class EuiNavDrawer extends Component {
});
};

// Although not used in `src/`, this method is available to and used in `src-docs/`
// for implementation-specific nav menu toggling via `ref` reference
toggleOpen = () => {
this.setState(
({ isCollapsed }) => ({
isCollapsed: !isCollapsed,
}),
() => {
this.setState(({ isCollapsed }) => ({
outsideClickDisabled: isCollapsed,
toolTipsEnabled: isCollapsed,
}));
}
);
};

collapseButtonClick = () => {
if (this.state.isCollapsed) {
this.expandDrawer();
Expand Down

0 comments on commit 0363814

Please sign in to comment.