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:
Matt Hillsdon
2026-06-09 15:07:19 +01:00
committed by GitHub
parent 37dbf5f35f
commit 5f76e2c8c2
+2 -2
View File
@@ -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;