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

Support locked FormFields #168

Open
rgimen3z opened this issue Jan 30, 2024 · 1 comment · May be fixed by #362
Open

Support locked FormFields #168

rgimen3z opened this issue Jan 30, 2024 · 1 comment · May be fixed by #362

Comments

@rgimen3z
Copy link
Contributor

Looks like BaseFormField was designed to support "locking"/"disabling" an input field:

However, this is not working for me even after extending the json_schema_field_to_field() method to also pass an extra locked=schema.get('locked', False) param to the FormFieldInput in:

return FormFieldInput(
name=name,
title=title,
html_type=input_html_type(schema),
required=required,
initial=schema.get('default'),
description=schema.get('description'),
)

I'm not sure, but I think the problem may lie somewhere in the npm package around the below lines?

required={required}
disabled={locked}

Anyone knows how to fix? Thanks in advance!

@samuelcolvin
Copy link
Member

I would try creating a FormFieldInput manually and seeing if you can get a field to lock. If so, it should be fairly easy to fix in JSON schema parsing.

@elio2t elio2t linked a pull request Oct 23, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants