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

DynamicForm - Form should hide fields that are hidden on the list content type #1862

Open
martinlingstuyl opened this issue Aug 14, 2024 · 0 comments

Comments

@martinlingstuyl
Copy link
Contributor

martinlingstuyl commented Aug 14, 2024

Category

[ ] Enhancement

[x] Bug

[ ] Question

Version 3.18.1

Expected / Desired Behavior / Question

If I'm rendering a form on a library with content types, and some fields are hidden at list content type level, those fields should not show up in the rendered dynamic form.

Observed Behavior

Fields that are hidden at content type level currently show up in the rendered form, I now have to work around that manually by adding these fields to the hiddenFields option, which is a shame, because I need to add quite some custom code to make that work.

Steps to Reproduce

Create a list content type with a couple of hidden fields, and render a DynamicForm, using the content type id:

public render(): React.ReactElement<{}> {
    return <>
      <DynamicForm 
        context={(this.props.context as any)} 
        listId={this.props.context.list.guid.toString()}
        listItemId={this.props.context.itemId}
        contentTypeId={this.props.context.contentType.id}      
      />
    </>;

The solution should probably be implemented in the following location. It would be easy to filter out fields based on field.Hidden.

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

No branches or pull requests

1 participant