diff --git a/lib/components/tab.js b/lib/components/tab.js index 33c31539..8c1e60a5 100644 --- a/lib/components/tab.js +++ b/lib/components/tab.js @@ -7,7 +7,8 @@ export default class Tab extends React.PureComponent { this.handleHover = this.handleHover.bind(this); this.handleBlur = this.handleBlur.bind(this); this.handleClick = this.handleClick.bind(this); - + this.handleMouseUp = this.handleMouseUp.bind(this); + this.state = { hovered: false }; @@ -27,11 +28,16 @@ export default class Tab extends React.PureComponent { handleClick(event) { const isLeftClick = event.nativeEvent.which === 1; - const isMiddleClick = event.nativeEvent.which === 2; if (isLeftClick && !this.props.isActive) { this.props.onSelect(); - } else if (isMiddleClick) { + } + } + + handleMouseUp(event) { + const isMiddleClick = event.nativeEvent.which === 2; + + if (isMiddleClick) { this.props.onClose(); } } @@ -55,6 +61,7 @@ export default class Tab extends React.PureComponent { {this.props.text}