diff --git a/frontend/components/dashboard/DashboardInputField.js b/frontend/components/dashboard/DashboardInputField.js index bba626207..be82c95c0 100644 --- a/frontend/components/dashboard/DashboardInputField.js +++ b/frontend/components/dashboard/DashboardInputField.js @@ -6,25 +6,6 @@ import guidGenerator from "../utilities/randomId"; const REGEX = /([$]{.*?})/g; -/** - * This function splits the input of a dashboard field into the parts that are inside and outside of ${...} - * @param {string} text - the value of the input in the Dashboard Input Field - * @returns - */ -const findReferences = (text) => { - var splitText = text.split("${"); - let textArray = [splitText[0]]; - for (var i = 1; i < splitText.length; i++) { - let insideBrackets = "${" + splitText[i].split("}")[0]; - if (splitText[i].includes("}")) { - insideBrackets += "}"; - } - textArray.push(insideBrackets); - textArray.push(splitText[i].split("}")[1]); - } - return textArray; -}; - /** * This component renders the input fields on the dashboard * @param {object} obj - the order number of a keyPair @@ -44,6 +25,12 @@ const DashboardInputField = ({ blurred, duplicates }) => { + const ref = useRef(null); + const syncScroll = (e) => { + ref.current.scrollTop = e.target.scrollTop; + ref.current.scrollLeft = e.target.scrollLeft; + }; + if (type === "varName") { const startsWithNumber = !isNaN(value.charAt(0)) && value != ""; const hasDuplicates = duplicates?.includes(value); @@ -75,13 +62,6 @@ const DashboardInputField = ({ ); } else if (type === "value") { - const ref = useRef(null); - - const syncScroll = (e) => { - ref.current.scrollTop = e.target.scrollTop; - ref.current.scrollLeft = e.target.scrollLeft; - }; - return (