From ff8071972229447a56d800ecf3dd1d04ce73c411 Mon Sep 17 00:00:00 2001 From: Katie Stahl Date: Tue, 3 Oct 2023 15:28:11 -0400 Subject: [PATCH] bugfix: removing identifier in front of chromosome on auto populate --- .../Input/TxSegmentElementInput/TxSegmentElementInput.tsx | 2 -- .../components/Utilities/GetCoordinates/GetCoordinates.tsx | 1 - .../main/shared/ChromosomeField/ChromosomeField.tsx | 7 +------ .../main/shared/GeneAutocomplete/GeneAutocomplete.tsx | 5 +++-- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/client/src/components/Pages/Structure/Input/TxSegmentElementInput/TxSegmentElementInput.tsx b/client/src/components/Pages/Structure/Input/TxSegmentElementInput/TxSegmentElementInput.tsx index 48e193b0..077808d0 100644 --- a/client/src/components/Pages/Structure/Input/TxSegmentElementInput/TxSegmentElementInput.tsx +++ b/client/src/components/Pages/Structure/Input/TxSegmentElementInput/TxSegmentElementInput.tsx @@ -439,9 +439,7 @@ const TxSegmentCompInput: React.FC = ({ diff --git a/client/src/components/Utilities/GetCoordinates/GetCoordinates.tsx b/client/src/components/Utilities/GetCoordinates/GetCoordinates.tsx index f24fedda..7e8f7431 100644 --- a/client/src/components/Utilities/GetCoordinates/GetCoordinates.tsx +++ b/client/src/components/Utilities/GetCoordinates/GetCoordinates.tsx @@ -252,7 +252,6 @@ const GetCoordinates: React.FC = () => { diff --git a/client/src/components/main/shared/ChromosomeField/ChromosomeField.tsx b/client/src/components/main/shared/ChromosomeField/ChromosomeField.tsx index b2b5cb09..26d02456 100644 --- a/client/src/components/main/shared/ChromosomeField/ChromosomeField.tsx +++ b/client/src/components/main/shared/ChromosomeField/ChromosomeField.tsx @@ -4,17 +4,13 @@ import HelpTooltip from "../HelpTooltip/HelpTooltip"; interface Props { fieldValue: string; - valueSetter: CallableFunction; errorText: string; - keyHandler: KeyboardEventHandler | undefined; width?: number | undefined; } const ChromosomeField: React.FC = ({ fieldValue, - valueSetter, errorText, - keyHandler, width, }) => { const useStyles = makeStyles(() => ({ @@ -42,11 +38,10 @@ const ChromosomeField: React.FC = ({ valueSetter(event.target.value)} error={errorText != ""} - onKeyDown={keyHandler} label="Chromosome" helperText={errorText != "" ? errorText : null} + contentEditable={false} className={classes.textField} /> diff --git a/client/src/components/main/shared/GeneAutocomplete/GeneAutocomplete.tsx b/client/src/components/main/shared/GeneAutocomplete/GeneAutocomplete.tsx index 85821a70..fbeb24b4 100644 --- a/client/src/components/main/shared/GeneAutocomplete/GeneAutocomplete.tsx +++ b/client/src/components/main/shared/GeneAutocomplete/GeneAutocomplete.tsx @@ -33,7 +33,7 @@ interface Props { setGene: CallableFunction; geneText: string; setGeneText: CallableFunction; - tooltipDirection: + tooltipDirection?: | "bottom" | "left" | "right" @@ -89,7 +89,8 @@ export const GeneAutocomplete: React.FC = ({ setGene(selection.value); setGeneValue(selection); if (setChromosome) { - setChromosome(selection.chromosome); + // substring is to remove identifier from beginning of chromosome (ex: result in NC_000007.14 instead of NCBI:NC_000007.14) + setChromosome(selection.chromosome?.substring(selection.chromosome.indexOf(":") + 1)); } if (setStrand) { setStrand(selection.strand);