Skip to content

Commit

Permalink
fix issue mui#2482 [Appbar] onLeftIconButtonTouchTap event doesn't fire.
Browse files Browse the repository at this point in the history
  • Loading branch information
MARY PRATIMA YEDLURI authored and MARY PRATIMA YEDLURI committed Sep 22, 2016
1 parent 02639f3 commit fbc9f5d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ function handleTouchTap() {
alert('onTouchTap triggered on the title component');
}

function handleTouchTapLeftIconButton() {
alert("onClick triggered on the left icon component");
}

const styles = {
title: {
cursor: 'pointer',
Expand All @@ -19,6 +23,7 @@ const AppBarExampleIconButton = () => (
title={<span style={styles.title}>Title</span>}
onTitleTouchTap={handleTouchTap}
iconElementLeft={<IconButton><NavigationClose /></IconButton>}
onLeftIconButtonTouchTap={handleTouchTapLeftIconButton }
iconElementRight={<FlatButton label="Save" />}
/>
);
Expand Down
2 changes: 2 additions & 0 deletions src/AppBar/AppBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ class AppBar extends Component {
const iconLeftStyle = Object.assign({}, styles.iconButtonStyle, iconStyleLeft);

if (showMenuIconButton) {
let self = this;
let iconElementLeftNode = iconElementLeft;

if (iconElementLeft) {
Expand All @@ -229,6 +230,7 @@ class AppBar extends Component {

iconElementLeftNode = React.cloneElement(iconElementLeft, {
iconStyle: Object.assign({}, iconButtonIconStyle, iconElementLeft.props.iconStyle),
onClick: self.handleTouchTapLeftIconButton.bind(self),
});
}

Expand Down

0 comments on commit fbc9f5d

Please sign in to comment.