From 3cb0d3a49fb9478111ccd8292fe956b4c15ed9ae Mon Sep 17 00:00:00 2001 From: Perry Mitchell Date: Fri, 15 Oct 2021 21:18:18 +0300 Subject: [PATCH] Fix mac copy user/pass shortcuts --- src/components/vault/EntriesList.js | 16 ++++++++++------ src/components/vault/EntryDetails.js | 1 - 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/components/vault/EntriesList.js b/src/components/vault/EntriesList.js index 938dae0..f53d190 100644 --- a/src/components/vault/EntriesList.js +++ b/src/components/vault/EntriesList.js @@ -28,8 +28,8 @@ const EntriesList = ({ className }) => { arrowUp: 'up', arrowDown: 'down', enter: 'enter', - copyUsername: 'ctrl+b', - copyPassword: 'ctrl+c' + copyUsername: ['ctrl+b', 'command+b'], + copyPassword: ['ctrl+c', 'command+c'] }; const handleNavigation = (event, step) => { event.preventDefault(); @@ -57,10 +57,14 @@ const EntriesList = ({ className }) => { document.activeElement.click(); } }, - copyUsername: () => - handleCopyField(entries[currentIndex].fields.find(field => field.title === 'Username')), - copyPassword: () => - handleCopyField(entries[currentIndex].fields.find(field => field.title === 'Password')) + copyUsername: e => { + e.preventDefault(); + handleCopyField(entries[currentIndex].fields.find(field => field.title === 'Username')); + }, + copyPassword: e => { + e.preventDefault(); + handleCopyField(entries[currentIndex].fields.find(field => field.title === 'Password')); + } }; return ( diff --git a/src/components/vault/EntryDetails.js b/src/components/vault/EntryDetails.js index 4948e70..e4f40c6 100644 --- a/src/components/vault/EntryDetails.js +++ b/src/components/vault/EntryDetails.js @@ -713,7 +713,6 @@ const FieldRow = ({ {field.property === 'url' ? ( { - console.log(e); (e.ctrlKey || e.metaKey) && window.open(field.value, '_blank'); }} title="open with Ctrl/Cmd + click"