Proposal: useForm setDisabled, isSubmitting, getSubmitProps #1376
SomeBody16
started this conversation in
Feature requests
Replies: 2 comments 3 replies
-
You can disable each field individually, I do think that it is a great idea to manage that on library level. |
Beta Was this translation helpful? Give feedback.
2 replies
-
👍 +1 for this idea. It is possible to |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Proposal
So, first example usage:
I personally like, when form is disabled during submitting, so when I receive errors from server, they will still relevant tu current form state
So my proposal is to add additional properties to useForm, to control when form will be disabled
I'm currently using this override:
So there are few things to discuss!
UseFormReturnType
disabled
- is the whole form disabledsetDisabled(disabled: boolean)
- disable formsetDisabled(field: keyof T, disabled: boolean)
to control each field? 🤔getSubmitProps()
- basicallytype=submit
and if disabledisSubmitting
- support for asynconSubmit
handlerUseFormInput
disableOnSubmitting?: boolean
- iftrue
then form will be disabled duringonSubmit
handler workingdisableOnlySubmitButtonDuringSubmitting?: boolean
(and then change this horrible long variable to something more compact)So after discussion I would love to contribute to this repo, and create this feature and section in documentation, if it's ok with current design
Beta Was this translation helpful? Give feedback.
All reactions