-
Notifications
You must be signed in to change notification settings - Fork 16
Milestone
Description
This is moved around a bit in #2540 but the problem is the same: the if (!type || !value) return is doing what it's supposed to do, but the form still resets on empty submit. Not sure why.
console/app/forms/firewall-rules-common.tsx
Lines 323 to 330 in 31520a2
| const submitHost = hostForm.handleSubmit(({ type, value }) => { | |
| // ignore click if empty or a duplicate | |
| // TODO: show error instead of ignoring click | |
| if (!type || !value) return | |
| if (hosts.value.some((t) => t.value === value && t.type === type)) return | |
| hosts.onChange([...hosts.value, { type, value }]) | |
| hostForm.reset(targetAndHostDefaultValues) | |
| }) |
2024-11-12-empty-target.mp4
Metadata
Metadata
Assignees
Labels
No labels