Unselect after touch drag as keys now invalidated due to new index order; Removing touchend from track

This commit is contained in:
James Barnsley
2017-07-23 08:50:15 +12:00
parent 48b32a4a5d
commit 37b0699540
2 changed files with 4 additions and 2 deletions

View File

@ -228,7 +228,7 @@ export default class Track extends React.Component{
className={className}
onMouseEnter={e => this.setState({hover: true})}
onMouseLeave={e => this.setState({hover: false})}
onTouchEnd={e => this.handleTouchEnd(e)} // When touch dragging is dropped on me
//onTouchEnd={e => this.handleTouchEnd(e)} // When touch dragging is dropped on me
onMouseDown={e => this.handleMouseDown(e)} // Click (or potentially a mouse drag start)
onMouseMove={e => this.handleMouseMove(e)} // Any movement over me
onMouseUp={e => this.handleMouseUp(e)} // End of click, or potentially a dragging drop event

View File

@ -171,8 +171,11 @@ class TrackList extends React.Component{
let siblings = over.parent().children('.track')
let dropped_at = siblings.index(over) - 1
console.log('touchend',helpers.arrayOf('index',this.digestTracksKeys()),'to',dropped_at)
if (this.props.reorderTracks !== undefined){
this.props.reorderTracks(helpers.arrayOf('index',this.digestTracksKeys()),dropped_at)
this.props.uiActions.setSelectedTracks([])
}
}
@ -394,7 +397,6 @@ class TrackList extends React.Component{
handleDrag={e => this.handleDrag(e, track_key)}
handleDrop={e => this.handleDrop(e, track_key)}
handleTouchDrag={e => this.handleTouchDrag(e, track_key)}
handleTouchDrop={e => this.handleTouchDrop(e, track_key)}
/>
)
}