mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-28 17:52:38 +00:00
"Rename searchButtonRef to submitButtonRef and update references"
This commit is contained in:
@@ -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) => {
|
||||
|
||||
<button
|
||||
id="searchButton"
|
||||
ref={searchButtonRef}
|
||||
ref={submitButtonRef}
|
||||
onClick={() => {
|
||||
loadPage(1, true, true);
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user