Fix tab navigation using mouse clicks (#732)

Fixes a bug introduced by #723
This commit is contained in:
David Gómez 2016-09-21 14:44:47 -04:00 committed by Matheus Fernandes
parent 4ec0156440
commit ac69e0b9a0

View file

@ -34,10 +34,8 @@ export default class Tab extends Component {
const isLeftClick = event.nativeEvent.which === 1;
const isMiddleClick = event.nativeEvent.which === 2;
if (isLeftClick) {
if (this.props.isActive === null) {
this.props.onSelect();
}
if (isLeftClick && !this.props.isActive) {
this.props.onSelect();
} else if (isMiddleClick) {
this.props.onClose();
}