mirror of
https://github.com/google/blockly.git
synced 2026-01-07 09:00:11 +01:00
chore: upgrade keyboard shortcuts and context menus to use non-deprecated APIs (#7352)
* chore: remove references to clipboard.copy in shortcuts * chore: remove references to clipboard.copy in context menus * chore: fix tests * chore: format * fix: PR comments
This commit is contained in:
@@ -331,9 +331,10 @@ export function registerDuplicate() {
|
||||
return 'hidden';
|
||||
},
|
||||
callback(scope: Scope) {
|
||||
if (scope.block) {
|
||||
clipboard.duplicate(scope.block);
|
||||
}
|
||||
if (!scope.block) return;
|
||||
const data = scope.block.toCopyData();
|
||||
if (!data) return;
|
||||
clipboard.paste(data, scope.block.workspace);
|
||||
},
|
||||
scopeType: ContextMenuRegistry.ScopeType.BLOCK,
|
||||
id: 'blockDuplicate',
|
||||
|
||||
Reference in New Issue
Block a user