cms icon indicating copy to clipboard operation
cms copied to clipboard

bug: Copying entire code snippet on text selection

Open nawinsharma opened this issue 1 year ago • 0 comments

Describe the bug When selecting any text from the code snippet section, the entire code snippet gets copied to the clipboard, instead of just the selected text.

To Reproduce Steps to reproduce the behavior:

  1. Navigate to the code snippet section.
  2. Select a portion of the text.
  3. The entire code snippet is copied to the clipboard.

Expected behavior Only the selected portion of the text should be highlighted.

Screenshots or GIFs

Image

code copied to clipboardL // SPDX-License-Identifier: Unlicense pragma solidity ^0.8.13; import "forge-std/Test.sol"; import "src/BridgeETH.sol"; import "src/USDT.sol"; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; contract BridgeETHTest is Test { event Transfer(address indexed from, address indexed to, uint256 value); BridgeETH bridge; USDT usdt; function setUp() public { usdt = new USDT(); bridge = new BridgeETH(address(usdt)); } function test_Deposit() public { usdt.mint(0x2966473D85A76A190697B5b9b66b769436EFE8e5, 200); vm.startPrank(0x2966473D85A76A190697B5b9b66b769436EFE8e5); usdt.approve(address(bridge), 200); bridge.deposit(usdt, 200); assertEq(usdt.balanceOf(0x2966473D85A76A190697B5b9b66b769436EFE8e5), 0); assertEq(usdt.balanceOf(address(bridge)), 200); bridge.withdraw(usdt, 100); assertEq(usdt.balanceOf(0x2966473D85A76A190697B5b9b66b769436EFE8e5), 100); assertEq(usdt.balanceOf(address(bridge)), 100); } }

Info (please complete the following information):

  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context Add any other context about the problem here.

nawinsharma avatar Feb 25 '25 04:02 nawinsharma