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

Change input element renaming style #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

utkarshsingh99
Copy link

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. 🙏

@knilink
Copy link
Owner

knilink commented Aug 31, 2020

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.

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 this pull request may close these issues.

2 participants