mirror of
https://github.com/google/blockly.git
synced 2026-06-15 15:45:13 +02:00
fix: only show paste hint toast on keyboard copy/cut (#9962)
This differs from the keyboard nav plugin but I think it's correct for an on-by-default world as it's very weird to encounter this toast on a touch device with and not helpful for mouse usage (e.g. in MakeCode's context menu).
This commit is contained in:
@@ -230,7 +230,7 @@ export function registerCopy() {
|
||||
? focused.getRelativeToSurfaceXY()
|
||||
: undefined;
|
||||
const copied = !!clipboard.copy(focused, copyCoords);
|
||||
if (copied) {
|
||||
if (copied && e instanceof KeyboardEvent) {
|
||||
showCopiedHint(workspace);
|
||||
}
|
||||
return copied;
|
||||
@@ -284,7 +284,7 @@ export function registerCut() {
|
||||
workspace.getAudioManager().play('delete');
|
||||
e.preventDefault();
|
||||
}
|
||||
if (copyData) {
|
||||
if (copyData && e instanceof KeyboardEvent) {
|
||||
showCutHint(workspace);
|
||||
}
|
||||
return !!copyData;
|
||||
|
||||
Reference in New Issue
Block a user