diff --git a/app/components/home/transaction-list/transaction-list-context-menu.ts b/app/components/home/transaction-list/transaction-list-context-menu.ts index bb07767..7f19e9e 100644 --- a/app/components/home/transaction-list/transaction-list-context-menu.ts +++ b/app/components/home/transaction-list/transaction-list-context-menu.ts @@ -6,7 +6,7 @@ import { hasMemo, getRecipientAddress } from '@utils/tx-utils'; export function registerHandler(el: HTMLButtonElement | null, handler: (e: Event) => void) { if (el === null) return; - el.addEventListener('contextmenu', handler, { passive: true }); + el.addEventListener('contextmenu', handler); } export function deregisterHandler(el: HTMLButtonElement | null, handler: (e: Event) => void) { @@ -28,7 +28,8 @@ interface TxListContextMenu { }; } -export function createTxListContextMenu({ tx, copy }: TxListContextMenu) { +export function createTxListContextMenu(event: Event, { tx, copy }: TxListContextMenu) { + event.preventDefault(); const { Menu, MenuItem } = remote; const menu = new Menu(); diff --git a/app/components/home/transaction-list/transaction-list-item.tsx b/app/components/home/transaction-list/transaction-list-item.tsx index 969649d..4afc9f6 100644 --- a/app/components/home/transaction-list/transaction-list-item.tsx +++ b/app/components/home/transaction-list/transaction-list-item.tsx @@ -42,7 +42,7 @@ export const TransactionListItem: FC = args => { const sumPrefix = direction === 'sent' ? '−' : ''; const memo = tx.tx_type === 'token_transfer' && - Buffer.from(tx.token_transfer.memo.replace('0x', '').replace(/^0+|0+$/g, ''), 'hex').toString( + Buffer.from(tx.token_transfer.memo.replace('0x', '').replace(/0+$/g, ''), 'hex').toString( 'utf8' ); const txDate = new Date(tx.burn_block_time_iso); @@ -73,7 +73,7 @@ export const TransactionListItem: FC = args => { useLayoutEffect(() => { const el = containerRef.current; - const contextMenuHandler = () => createTxListContextMenu({ tx, copy }); + const contextMenuHandler = (event: Event) => createTxListContextMenu(event, { tx, copy }); registerHandler(el, contextMenuHandler); return () => deregisterHandler(el, contextMenuHandler); }, [tx, copy]);