Keyboard selecting of tracks, now native

This commit is contained in:
James Barnsley
2016-10-17 22:00:29 +13:00
parent 97026753a0
commit 6a07ebc8f6
12 changed files with 149 additions and 25 deletions

View File

@ -13,6 +13,10 @@ export default class ConfirmationButton extends React.Component{
this.unconfirmTimer = false;
}
componentWillUnmount(){
clearTimeout( this.unconfirmTimer );
}
handleClick(e){
if( this.state.confirming ){
this.setState({ confirming: false });
@ -27,12 +31,14 @@ export default class ConfirmationButton extends React.Component{
}
handleMouseLeave(e){
this.unconfirmTimer = setTimeout(
function(){
this.setState({ confirming: false });
}.bind(this),
1500
);
if( this.state.confirming ){
this.unconfirmTimer = setTimeout(
function(){
this.setState({ confirming: false });
}.bind(this),
1500
);
}
}
render(){