Commit b46f58d2 authored by Viacheslav Pavlov's avatar Viacheslav Pavlov
Browse files

Merge branch '133-buttonbar-component' into 'master'

ButtonBar nested dialogs fix

Closes #133

See merge request genesys-pgr/genesys-ui!138
parents 91f1ccc6 236880cc
......@@ -97,6 +97,9 @@ const styles = (theme) => ({
backgroundColor: 'transparent',
}
},
},
hidden: {
visibility: 'hidden' as 'hidden',
}
/* tslint:enable */
});
......@@ -112,24 +115,28 @@ class ButtonBar extends React.Component<IButtonBarProps, any> {
super(props);
this.state = {
anchorEl: null,
hidden: true,
};
}
private handleClickListItem = (event) => {
this.setState({ anchorEl: event.currentTarget });
this.setState({ hidden: false });
}
private handleMenuItemClick = (event, index) => {
this.setState({ anchorEl: null });
// this.setState({ anchorEl: null });
this.setState({ hidden: true });
}
private handleClose = () => {
this.setState({ anchorEl: null });
// this.setState({ anchorEl: null });
this.setState({ hidden: true });
}
public render() {
const { classes, children, barLabelText } = this.props;
const { anchorEl } = this.state;
const { anchorEl, hidden } = this.state;
const childrenArr = React.Children.toArray(children) as any;
......@@ -155,7 +162,7 @@ class ButtonBar extends React.Component<IButtonBarProps, any> {
anchorEl={ anchorEl }
open={ Boolean(anchorEl) }
onClose={ this.handleClose }
className={ classes.list }
className={ `${classes.list} ${hidden ? classes.hidden : ''}` }
>
{ childrenArr.map((button, index) => (
button && !(button.props && button.props.children === false) && (
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment