Add missing type attibute to FileComponent (#3481)
This commit is contained in:
parent
b21e2efaf0
commit
066ecbe3e2
1 changed files with 11 additions and 0 deletions
|
@ -18,6 +18,7 @@ export const FileComponent = ({
|
||||||
const { t } = useTranslation("dynamic");
|
const { t } = useTranslation("dynamic");
|
||||||
const { control } = useFormContext();
|
const { control } = useFormContext();
|
||||||
const [filename, setFilename] = useState("");
|
const [filename, setFilename] = useState("");
|
||||||
|
const [isLoading, setIsLoading] = useState(false);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<FormGroup
|
<FormGroup
|
||||||
|
@ -35,8 +36,18 @@ export const FileComponent = ({
|
||||||
<FileUpload
|
<FileUpload
|
||||||
id={name!}
|
id={name!}
|
||||||
value={value}
|
value={value}
|
||||||
|
type="text"
|
||||||
filename={filename}
|
filename={filename}
|
||||||
isDisabled={isDisabled}
|
isDisabled={isDisabled}
|
||||||
|
onFileInputChange={(_, file) => setFilename(file.name)}
|
||||||
|
onReadStarted={() => setIsLoading(true)}
|
||||||
|
onReadFinished={() => setIsLoading(false)}
|
||||||
|
onClearClick={() => {
|
||||||
|
onChange("");
|
||||||
|
setFilename("");
|
||||||
|
}}
|
||||||
|
isLoading={isLoading}
|
||||||
|
allowEditingUploadedText={false}
|
||||||
onChange={(value, filename) => {
|
onChange={(value, filename) => {
|
||||||
onChange(value);
|
onChange(value);
|
||||||
setFilename(filename);
|
setFilename(filename);
|
||||||
|
|
Loading…
Reference in a new issue