Skip to content

Commit

Permalink
Fix EuiNavDrawer to not rely on managleable function names (#2178)
Browse files Browse the repository at this point in the history
* Fix EuiNavDrawer to not rely on managleable function names

* changelog
  • Loading branch information
chandlerprall authored Jul 29, 2019
1 parent 028b9a4 commit d378af1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
- Added `"center"` as an acceptable value to `EuiBasicTable`'s `align` proptype ([#2158](https://github.com/elastic/eui/pull/2158))
- Fixed `.eui-textBreakWord` utility class to be cross-browser compatible ([#2157](https://github.com/elastic/eui/pull/2157))
- Fixed truncation and z-index of `EuiFilePicker` ([#2145](https://github.com/elastic/eui/pull/2145))
- Fixed `EuiNavDrawer`'s support for flyout groups in production/minified builds ([#2178](https://github.com/elastic/eui/pull/2178))

## [`13.0.0`](https://github.com/elastic/eui/tree/v13.0.0)

Expand Down
3 changes: 2 additions & 1 deletion src/components/nav_drawer/nav_drawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import classNames from 'classnames';
import { EuiListGroup, EuiListGroupItem } from '../list_group';
import { EuiNavDrawerFlyout } from './nav_drawer_flyout';
import { EuiNavDrawerGroup } from './nav_drawer_group';
import { EuiOutsideClickDetector } from '../outside_click_detector';
import { EuiI18n } from '../i18n';
import { EuiFlexItem } from '../flex';
Expand Down Expand Up @@ -216,7 +217,7 @@ export class EuiNavDrawer extends Component {
// 1. Loop through the EuiNavDrawer children (EuiListGroup, EuiHorizontalRules, etc)
modifiedChildren = React.Children.map(this.props.children, child => {
// 2. Check if child is an EuiNavDrawerGroup and if it does have a flyout, add the expand function
if (child.type.name === 'EuiNavDrawerGroup') {
if (child.type === EuiNavDrawerGroup) {
const item = React.cloneElement(child, {
flyoutMenuButtonClick: this.expandFlyout,
showToolTips: this.state.toolTipsEnabled && showToolTips,
Expand Down

0 comments on commit d378af1

Please sign in to comment.