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

Render without form tag? #71

Closed
zbyte64 opened this issue Mar 17, 2016 · 6 comments
Closed

Render without form tag? #71

zbyte64 opened this issue Mar 17, 2016 · 6 comments

Comments

@zbyte64
Copy link

zbyte64 commented Mar 17, 2016

I want to use this project to extend existing forms but I cannot render the Form component inside another form. The two solutions I see is to convert the existing form code into schema json and merge it with the user supplied schema OR have the option to render without the form tag. Merging the fields should work but there are cases where the existing form layout would be difficult to represent with ui schema and jsonschema (examples: an "advanced" section which collapses down, code editor with codemirror, and embedded previews next to fields). It seems having control over whether to render the form tag would be more robust.

@zbyte64
Copy link
Author

zbyte64 commented Mar 19, 2016

If I sent a pull request that implemented Fieldset which acts like Form but without the form specifics, would it be accepted (assuming all contributing guidelines is followed)?

@n1k0
Copy link
Collaborator

n1k0 commented Mar 19, 2016

If I sent a pull request that implemented Fieldset which acts like Form but without the form specifics, would it be accepted (assuming all contributing guidelines is followed)?

If usage remains backward compatible and the code is good, definitely yes :)

@fermuch
Copy link

fermuch commented Apr 5, 2016

why don't you just use the component SchemaField?

Checkout how it is being used here: https://github.com/mozilla-services/react-jsonschema-form/blob/master/src/components/Form.js

@zbyte64
Copy link
Author

zbyte64 commented Apr 26, 2016

Yes, I ended up using SchemaField and copying over all the Form methods except onSubmit. As to why not to do this: it is not DRY. Trying to factor out the common logic to another component either meant inheriting the common component or rendering a new sub-component which broke allot of unit tests that do internal state checks.

@derekdon
Copy link

derekdon commented Nov 6, 2017

Any update on the best approach to this? Would like to drop a react-jsonschema-form powered fieldset into an existing form.

@epicfaace
Copy link
Member

This was fixed by #1345!

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

5 participants