web: components: Fixed Cannot read property 'preventDefault' of undefined

This commit is contained in:
Alexey Safronov 2019-08-07 17:37:18 +03:00
parent f79647833b
commit 56acf17769

View File

@ -138,7 +138,7 @@ class MainButton extends React.PureComponent {
}
}
onMainButtonClick = () => {
onMainButtonClick = (e) => {
if (!this.props.isDisabled) {
if (!this.props.isDropdown) {
this.props.clickAction && this.props.clickAction();
@ -146,7 +146,7 @@ class MainButton extends React.PureComponent {
this.toggle(!this.state.isOpen);
}
} else {
this.stopAction();
this.stopAction(e);
}
};
@ -155,11 +155,11 @@ class MainButton extends React.PureComponent {
this.toggle(!this.state.isOpen);
};
onSecondaryButtonClick = () => {
onSecondaryButtonClick = (e) => {
if (!this.props.isDisabled) {
this.props.clickActionSecondary && this.props.clickActionSecondary();
} else {
this.stopAction();
this.stopAction(e);
}
};