From b6e904c9c8c9a603004c76fde5da65154acaff61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Losada=20Hern=C3=A1ndez?= Date: Sun, 1 Sep 2024 11:19:00 +0200 Subject: [PATCH] "Rename searchButtonRef to submitButtonRef and update references" --- client/homebrew/pages/vaultPage/vaultPage.jsx | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/client/homebrew/pages/vaultPage/vaultPage.jsx b/client/homebrew/pages/vaultPage/vaultPage.jsx index 67d7c9fe0..d722ba297 100644 --- a/client/homebrew/pages/vaultPage/vaultPage.jsx +++ b/client/homebrew/pages/vaultPage/vaultPage.jsx @@ -32,7 +32,7 @@ const VaultPage = (props) => { const countRef = useRef(null); const v3Ref = useRef(null); const legacyRef = useRef(null); - const searchButtonRef = useRef(null); + const submitButtonRef = useRef(null); useEffect(() => { disableSubmitIfFormInvalid(); @@ -183,11 +183,8 @@ const VaultPage = (props) => { pattern=".{3,}" title="At least 3 characters" onKeyDown={(e) => { - if (e.key === 'Enter') { - if (!searchButtonRef.current.disabled) { - loadPage(1, true, true); - } - } + if (e.key === 'Enter' && !submitButtonRef.current.disabled) + loadPage(1, true, true); }} placeholder="v3 Reference Document" /> @@ -203,11 +200,8 @@ const VaultPage = (props) => { defaultValue={author} onKeyUp={disableSubmitIfFormInvalid} onKeyDown={(e) => { - if (e.key === 'Enter') { - if (!searchButtonRef.current.disabled) { - loadPage(1, true, true); - } - } + if (e.key === 'Enter' && !submitButtonRef.current.disabled) + loadPage(1, true, true); }} placeholder="Gazook89" /> @@ -247,7 +241,7 @@ const VaultPage = (props) => {