Skip to content

Commit

Permalink
empty fields for bulk edition by default. submit button disabled unti…
Browse files Browse the repository at this point in the history
…l fields are populated.
  • Loading branch information
andresgnlez committed Sep 10, 2024
1 parent 8b2d587 commit f4f9c14
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,11 @@ const EditModal = ({
initialValues={{
mode: 'all',
target:
(selectedFeatures?.length === 1 && selectedFeatures?.[0]?.marxanSettings?.prop) || 50,
spf: (selectedFeatures?.length === 1 && selectedFeatures?.[0]?.marxanSettings?.fpf) || 1,
(selectedFeatures?.length === 1 && selectedFeatures?.[0]?.marxanSettings?.prop) ||
undefined,
spf:
(selectedFeatures?.length === 1 && selectedFeatures?.[0]?.marxanSettings?.fpf) ||
undefined,
}}
onSubmit={onEditSubmit}
render={({ form, handleSubmit }) => {
Expand Down Expand Up @@ -297,7 +300,12 @@ const EditModal = ({
Cancel
</Button>

<Button theme="primary" size="xl" type="submit">
<Button
theme="primary"
size="xl"
type="submit"
disabled={formRef.current?.getState().invalid}
>
Save
</Button>
</div>
Expand Down

0 comments on commit f4f9c14

Please sign in to comment.