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

Disabled prop does not disable form using chakra-ui theme #3839

Open
4 tasks done
jrpolesi opened this issue Aug 23, 2023 · 3 comments
Open
4 tasks done

Disabled prop does not disable form using chakra-ui theme #3839

jrpolesi opened this issue Aug 23, 2023 · 3 comments
Labels
bug chakra-ui Chakra ui related theme issue help wanted

Comments

@jrpolesi
Copy link

Prerequisites

What theme are you using?

chakra-ui

Version

5.12.1

Current Behavior

The disabled and readonly prop is not working correctly in 2.8.0 version of chakra-ui

When the disabled or readonly prop is used to change the behavior of the whole form, only the inputs are being disabled, the interface buttons remain enabled, allowing moving, adding or removing items from the form

What is probably causing this bug is that react-jsonschema-form uses disabled prop to disable buttons but chakra-ui is always overriding the disabled prop as mentioned in this issue chakra-ui/chakra-ui#7269

Expected Behavior

When using the props disabled={true} or readonly={true} directly on the Form component, it should disable the whole form, including the interface buttons

Steps To Reproduce

  1. In this codesandbox
  2. Add disabled or readonly prop to RJSForm component
  3. Buttons are still clickable

Environment

- OS: Pop!_OS 20.04
- Node: 18.14.1
- npm: 9.3.1

Anything else?

No response

@jrpolesi jrpolesi added bug needs triage Initial label given, to be assigned correct labels and assigned labels Aug 23, 2023
@nickgros
Copy link
Contributor

Thanks for the report. Seems like we must use their custom props. A PR to fix this would be welcome.

@nickgros nickgros added help wanted chakra-ui Chakra ui related theme issue and removed needs triage Initial label given, to be assigned correct labels and assigned labels Aug 25, 2023
@Sachin-chaurasiya
Copy link

Hello @nickgros, I would like to take this up, could you please assign this to me and assist me?

@nickgros
Copy link
Contributor

nickgros commented Dec 8, 2023

@Sachin-chaurasiya you are welcome to make a PR, which we will happily review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug chakra-ui Chakra ui related theme issue help wanted
Projects
None yet
Development

No branches or pull requests

3 participants