From fe9ec857362d53c520cf2e5f598005f7ee08d543 Mon Sep 17 00:00:00 2001 From: vsp05 Date: Sun, 9 Jun 2024 16:05:42 -0500 Subject: [PATCH] #2496: fixed delete button so that it is gray from the start (using isValid) --- .../DeleteWorkPackageModalContainer/DeleteWorkPackageView.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontend/src/pages/WorkPackageDetailPage/DeleteWorkPackageModalContainer/DeleteWorkPackageView.tsx b/src/frontend/src/pages/WorkPackageDetailPage/DeleteWorkPackageModalContainer/DeleteWorkPackageView.tsx index eb8eef4cb6..2502fbc7de 100644 --- a/src/frontend/src/pages/WorkPackageDetailPage/DeleteWorkPackageModalContainer/DeleteWorkPackageView.tsx +++ b/src/frontend/src/pages/WorkPackageDetailPage/DeleteWorkPackageModalContainer/DeleteWorkPackageView.tsx @@ -33,7 +33,7 @@ const DeleteWorkPackageView: React.FC = ({ workPacka handleSubmit, control, reset, - formState: { errors } + formState: { errors, isValid } } = useForm({ resolver: yupResolver(schema), defaultValues: { @@ -56,8 +56,8 @@ const DeleteWorkPackageView: React.FC = ({ workPacka handleUseFormSubmit={handleSubmit} onFormSubmit={onSubmitWrapper} formId="delete-wp-form" + disabled={!isValid} showCloseButton - disabled={errors.wbsNum !== undefined} > Are you sure you want to delete work package #{wbsPipe(workPackage)}?