Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disabling the form should disable the submit button as well. #3264

Closed
4 tasks done
dwjohnston opened this issue Nov 30, 2022 · 2 comments · Fixed by #3537
Closed
4 tasks done

Disabling the form should disable the submit button as well. #3264

dwjohnston opened this issue Nov 30, 2022 · 2 comments · Fixed by #3537

Comments

@dwjohnston
Copy link
Contributor

dwjohnston commented Nov 30, 2022

Prerequisites

What theme are you using?

core

Version

4.2.3

Current Behavior

When I pass the disabled props, all inputs are disabled, but the form can still be submitted by pressing the submit button, which is still enabled.

Expected Behavior

The submit button should be disabled.

Steps To Reproduce

https://codesandbox.io/s/lucid-dawn-k56bdt?file=/src/App.js (4.2.3)

Environment

See sandbox

Anything else?

Similar issues:

#854 - suggestion - pass in empty div as children to remove the submit buttton

Another option is to pass the uiSchema prop in with the ui:submitButtonOptions.props.disabled when you are trying to disable the form.

P.S Fantastic work with this library. This thing is great.

@dwjohnston dwjohnston added bug needs triage Initial label given, to be assigned correct labels and assigned labels Nov 30, 2022
@heath-freenome heath-freenome added help wanted and removed needs triage Initial label given, to be assigned correct labels and assigned labels Dec 23, 2022
@heath-freenome
Copy link
Member

@dwjohnston Good point. The fix for this is fairly simple (updating the SubmitButtonProps in @rjsf/utils to add disabled and then passing it in from the Form.tsx in @rjsf/core). Are you able to fix it yourself for us?

@dwjohnston
Copy link
Contributor Author

@heath-freenome Sure, I can take a look. I am pretty busy right now, but sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants