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

Two children with same name and value to different parrents bug #50

Open
makatsis opened this issue Jan 13, 2023 · 1 comment
Open

Two children with same name and value to different parrents bug #50

makatsis opened this issue Jan 13, 2023 · 1 comment
Assignees
Labels
discussion In the disscussion

Comments

@makatsis
Copy link

Suppose that we have the following tree
const categoriesOptions = [
{
name: 'Non-residential',
value: 'Non-residential',
children: [
{
name: 'Education',
value: 'Education',
children: []
},
{
name: 'N/A',
value: 'N/A',
children: []
}
]
},
{
name: 'Residential',
value: 'Residential',
children: [
{
name: 'Apartment blocks',
value: 'Apartment blocks',
children: []
},
{
name: 'N/A',
value: 'N/A',
children: []
}
]
}
]

The library is not working because the parents (Non-residential, Residential) has to children with the same name and value. Is there a way to be fixed, without changing the name and the value?

Thank you!

@dipson88
Copy link
Owner

Hi @makatsis, now it is not possible. The value should be unique for every value, but you can use the same name.
I can suggest creating a mapper and mapping your values with diff ids - and after selecting remap value to the traditional value that you need.

@dipson88 dipson88 self-assigned this Jan 28, 2023
@dipson88 dipson88 added the discussion In the disscussion label Jan 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion In the disscussion
Projects
None yet
Development

No branches or pull requests

2 participants