From 324e08c6a4b8fb2cf60161c566be349e102c16ea Mon Sep 17 00:00:00 2001 From: Ash Wilson Date: Fri, 4 May 2018 08:51:51 -0400 Subject: [PATCH] Reset mouseSelectionInProgress synchronously on mouseUp --- lib/views/staging-view.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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() {