diff --git a/esp/src/src-react/components/forms/landing-zone/FileListForm.tsx b/esp/src/src-react/components/forms/landing-zone/FileListForm.tsx index 1112167f2a1..bda1c8bc8e3 100644 --- a/esp/src/src-react/components/forms/landing-zone/FileListForm.tsx +++ b/esp/src/src-react/components/forms/landing-zone/FileListForm.tsx @@ -8,12 +8,17 @@ import { TargetDropzoneTextField, TargetFolderTextField, TargetServerTextField } import { joinPath } from "src/Utility"; import nlsHPCC from "src/nlsHPCC"; import { MessageBox } from "../../../layouts/MessageBox"; +import { debounce } from "../../../util/throttle"; import * as FormStyles from "./styles"; const logger = scopedLogger("src-react/components/forms/landing-zone/FileListForm.tsx"); const myFileSprayService = new FileSprayService({ baseUrl: "" }); +const targetFolderTextChange = debounce((text, directory, onChange) => { + onChange(directory + text); +}, 200); + interface FileListFormValues { dropzone: string; machines: string; @@ -61,6 +66,8 @@ export const FileListForm: React.FunctionComponent = ({ const closeForm = React.useCallback(() => { setShowForm(false); + const uploaderBtn = document.querySelector("#uploaderBtn"); + uploaderBtn["value"] = null; }, [setShowForm]); const doSubmit = React.useCallback((data) => { @@ -235,8 +242,11 @@ export const FileListForm: React.FunctionComponent = ({ machineOS={os} required={true} placeholder={nlsHPCC.SelectValue} + onInputValueChange={(text) => targetFolderTextChange(text, directory, onChange)} onChange={(evt, option) => { - onChange(option.key); + if (option?.key) { + onChange(option.key); + } }} errorMessage={error && error?.message} />}