Skip to content

Commit

Permalink
feat: Display a 'wait' cursor when opening trashcan (#6699)
Browse files Browse the repository at this point in the history
No visible change for regular case.  But if there's thousands of blocks in the trash, the visual feedback that something's happening is better.  Otherwise the user clicks, and that click will cause some random block to be spawned out of the trash.
  • Loading branch information
NeilFraser authored Dec 14, 2022
1 parent f528ecc commit fccf8e4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion core/trashcan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,13 @@ export class Trashcan extends DeleteArea implements IAutoHideable,
const contents = this.contents_.map(function(string) {
return JSON.parse(string);
});
this.flyout?.show(contents);
// Trashcans with lots of blocks can take a second to render.
const blocklyStyle = this.workspace.getParentSvg().style;
blocklyStyle.cursor = 'wait';
setTimeout(() => {
this.flyout?.show(contents);
blocklyStyle.cursor = '';
}, 10);
this.fireUiEvent_(true);
}

Expand Down

0 comments on commit fccf8e4

Please sign in to comment.