react-jsonschema-formbuilder icon indicating copy to clipboard operation
react-jsonschema-formbuilder copied to clipboard

Change input element renaming style

Open utkarshsingh99 opened this issue 5 years ago • 1 comments

Hi,

I was using this repo as a component for another project of mine, and I found that the logic in the core.js file (especially the getNodeByRjsfId) could be simplified if we just change the renaming style of similar Menu elements.

Since the node's rjsf-id uses _ as a separator between properties (templatename_parentname_...), I think using a different separator would be better.

P.S.: Really great work on building this form builder. Great code. :pray:

utkarshsingh99 avatar Aug 25 '20 06:08 utkarshsingh99

Hi @utkarshsingh99,

Thanks for the interest in this project. The purpose of the complex logic in getNodeByRjsfId is to support _ as best as it can, since it's quite a commonly used character in the filed name. The root issue is in rjsf. They way how it generate the id is problematic, for example:

{
  foo: { bar_baz: { $id: 'foo_bar_baz' } },
  foo_bar: { baz: { $id: 'foo_bar_baz' } },
}

The separator character in the field name should have escaped in this case. Hope this issue get resolved soon. So I tend to keep it as it is for now.

I'm also refactoring this project to use the new form framework that I made recently. https://github.com/gravel-form/gravel https://github.com/gravel-form/antd-form Hope they're worth for you to have a look.

My main focus at the moment is to move toward gravel-form. I'll still maintain the support for rjsf such as upgrading packages occasionally but will no long adding new feature to it.

knilink avatar Aug 31 '20 13:08 knilink