diff --git a/src/controls/InputField.jsx b/src/controls/InputField.jsx index f3b5b4265..0b8f849fa 100644 --- a/src/controls/InputField.jsx +++ b/src/controls/InputField.jsx @@ -1,12 +1,20 @@ import { motion } from "framer-motion"; import useMobile from "../layout/Responsive"; import style from "../style"; -import { useRef, useState } from "react"; +import { useState } from "react"; export default function InputField(props) { - const { onChange, padding, width, type, inputmode, pattern, value } = props; + const { + onChange, + padding, + width, + type, + inputmode, + pattern, + value, + placeholder, + } = props; const [inputValue, setInputValue] = useState(value ? value : ""); - const placeholder = useRef(props.placeholder); const mobile = useMobile(); const re = /^[0-9\b]*[.]?[0-9\b]*?$/; const onInput = (e) => { @@ -68,7 +76,7 @@ export default function InputField(props) { setInputValue(e.target.value); }} value={inputValue} - placeholder={placeholder.current} + placeholder={placeholder} /> ); } diff --git a/src/pages/policy/input/ParameterEditor.jsx b/src/pages/policy/input/ParameterEditor.jsx index 3f0d59020..c5c294ba7 100644 --- a/src/pages/policy/input/ParameterEditor.jsx +++ b/src/pages/policy/input/ParameterEditor.jsx @@ -138,7 +138,7 @@ export default function ParameterEditor(props) { {editControl}