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

*Field not rendering in Create, only in Edit #8384

Closed
gartner opened this issue Nov 10, 2022 · 3 comments
Closed

*Field not rendering in Create, only in Edit #8384

gartner opened this issue Nov 10, 2022 · 3 comments

Comments

@gartner
Copy link
Contributor

gartner commented Nov 10, 2022

What you were expecting:
I'm using an ArrayInput, with a SimpleFormIterator, which again has a FormDataConsumer, to let me include a FunctionField or TextField in a form.

What happened instead:
When this is used inside an Edit, it does render all the fields, both FunctionField and TextField. But when in a Create, only Inputs are displayed - not Fields.

Steps to reproduce:
Codesandbox

@WiXSL
Copy link
Contributor

WiXSL commented Nov 11, 2022

Most likely related to #8359

@gartner
Copy link
Contributor Author

gartner commented Nov 11, 2022

I have added a Codesandbox which demonstrates the problem: When editing the record with posts, the TextField is displayed. But when creating a new record, it is not, only Inputs are shown.

@WiXSL
Copy link
Contributor

WiXSL commented Nov 14, 2022

Th edit view works fine in your example, is the create that has a problem

You can get it like this:

<Labeled label="Body">
    <FunctionField
        /* @ts-ignore */
        render={record => {
            return record.body;
        }}
        /* @ts-ignore */
        source={getSource('body')}
        record={scopedFormData}
    />
</Labeled>

@WiXSL WiXSL closed this as completed Nov 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants