diff --git a/components/ParameterBox.tsx b/components/ParameterBox.tsx index 6dc5016..538127d 100644 --- a/components/ParameterBox.tsx +++ b/components/ParameterBox.tsx @@ -20,6 +20,12 @@ export const ParameterBox: React.FC<{ parameter: ParameterDetail }> = ({ paramet sx={{ marginTop: ".8em" }} onMouseEnter={() => setHover(true)} onMouseLeave={() => setHover(false)} + onClick={async () => { + // Copy link to clipboard + const url = new URL(window.location.href); + url.hash = parameterId; + await navigator.clipboard.writeText(url.toString()); + }} > @@ -28,15 +34,7 @@ export const ParameterBox: React.FC<{ parameter: ParameterDetail }> = ({ paramet {parameterName} {hover && ( - ) => { - e.stopPropagation() - // Copy link to clipboard - const url = new URL(window.location.href); - url.hash = parameterId; - await navigator.clipboard.writeText(url.toString()); - }}> + )} diff --git a/components/Parameters.tsx b/components/Parameters.tsx index cfa64fa..2884a97 100644 --- a/components/Parameters.tsx +++ b/components/Parameters.tsx @@ -65,6 +65,12 @@ const Parameters: React.FC<{ parameters: ParametersArray }> = ({ parameters }) = key={group} onMouseEnter={() => setHover(true)} onMouseLeave={() => setHover(false)} + onClick={async () => { + // Copy link to clipboard + const url = new URL(window.location.href); + url.hash = group + await navigator.clipboard.writeText(url.toString()); + }} > = ({ parameters }) = > {group} {hover && group && group !== "" && ( - ) => { - e.stopPropagation() - // Copy link to clipboard - const url = new URL(window.location.href); - url.hash = group - await navigator.clipboard.writeText(url.toString()); - }} - > + )}