diff --git a/lib/views/staging-view.js b/lib/views/staging-view.js index 86796f5757..b067f258ad 100644 --- a/lib/views/staging-view.js +++ b/lib/views/staging-view.js @@ -778,15 +778,17 @@ export default class StagingView extends React.Component { } async mouseup() { + const hadSelectionInProgress = this.mouseSelectionInProgress; + this.mouseSelectionInProgress = false; + await new Promise(resolve => { this.setState(prevState => ({ selection: prevState.selection.coalesce(), }), resolve); }); - if (this.mouseSelectionInProgress) { + if (hadSelectionInProgress) { this.debouncedDidChangeSelectedItem(true); } - this.mouseSelectionInProgress = false; } undoLastDiscard() {