Skip to content

Commit

Permalink
🐛 Save button always enabled for custom-target edit (#1082)
Browse files Browse the repository at this point in the history
- Fixes an issue where the save button is always enabled for
custom-target-update form. This is because the default handler calls
setValue due to the file upload component form state being manually
managed by the useRuleFiles component. This fix bypasses the setValue
call for initially loaded placeholder files.
Closes #1073

Signed-off-by: ibolton336 <[email protected]>
  • Loading branch information
ibolton336 authored Jun 30, 2023
1 parent bfe83ff commit cd9ecaf
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,13 @@ export const CustomTargetForm: React.FC<CustomTargetFormProps> = ({
<MultipleFileUploadStatusItem
file={file.fullFile}
key={file.fileName}
customFileHandler={(file) => handleFile(file)}
customFileHandler={(file) => {
if (file.type === "placeholder") {
return null;
} else {
return handleFile(file);
}
}}
onClearClick={() => removeFiles([file.fileName])}
progressValue={getloadPercentage(file.fileName)}
progressVariant={getloadResult(file.fileName)}
Expand Down

0 comments on commit cd9ecaf

Please sign in to comment.