diff --git a/src/components/InstructionMenu.tsx b/src/components/InstructionMenu.tsx index 9394e70..cb7e3c6 100644 --- a/src/components/InstructionMenu.tsx +++ b/src/components/InstructionMenu.tsx @@ -15,6 +15,19 @@ const HtmlTooltip = styled(({ className, ...props }: TooltipProps) => ( } })) +function handleDragStart( + instruction: Instruction, + event: React.DragEvent | undefined +): void { + if (event === undefined) { + console.log("handleDragStart: event is undefined") + return + } + + event.dataTransfer.dropEffect = "copy" + event.dataTransfer.setData("text/plain", instruction.symbol) +} + export default function InstructionMenu() { let key = 0 @@ -32,11 +45,13 @@ export default function InstructionMenu() { {instruction.description} }> +
handleDragStart(instruction, event)}> {instruction.symbol} +
)