Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit fbaf0d4

Browse files
authored
Merge pull request #1435 from atom/aw/stop-selection-sync
Reset mouseSelectionInProgress synchronously on mouseUp
2 parents dff74ba + 324e08c commit fbaf0d4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

lib/views/staging-view.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -778,15 +778,17 @@ export default class StagingView extends React.Component {
778778
}
779779

780780
async mouseup() {
781+
const hadSelectionInProgress = this.mouseSelectionInProgress;
782+
this.mouseSelectionInProgress = false;
783+
781784
await new Promise(resolve => {
782785
this.setState(prevState => ({
783786
selection: prevState.selection.coalesce(),
784787
}), resolve);
785788
});
786-
if (this.mouseSelectionInProgress) {
789+
if (hadSelectionInProgress) {
787790
this.debouncedDidChangeSelectedItem(true);
788791
}
789-
this.mouseSelectionInProgress = false;
790792
}
791793

792794
undoLastDiscard() {

0 commit comments

Comments
 (0)