Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert EuiNavDrawer toggleOpen removal #2682

Merged
merged 4 commits into from
Dec 17, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)

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 imlementation-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