jakezatecky / react-checkbox-tree

A simple and elegant checkbox tree for React.

Home Page:https://jakezatecky.github.io/react-checkbox-tree/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Duplicate value detected starting from version 1.7.3

SergioArrighi opened this issue · comments

Describe the bug
Upgraded from version 1.6.0 to version 1.7.3.
My data set contains some leaf nodes with duplicate value.
This was working perfectly fine in 1.6.0 with the tree showing no clue of issues.

Reproduction steps
Please include the necessary steps to reproduce the issue as well as a live example that showcases it. You can modify this CodeSandbox reference point to create a working example.
Create a data source with nodes having non-unique values.
Feed it to CheckboxTree element

Expected behavior
Please include a clear and concise description of what you expected to happen.
Tree is displayed

Screenshots
Javascript error
message: "Duplicate value '/BLR1/05_BT_AY_Domestic-RT.postman_collection.json/05_Get Cart' detected.

Unfortunately, it was never intended to allow duplicate values, as this component makes an assumption that each node has a different value. While allowing duplicate values could be seen as a feature in some use cases and contexts, in most scenarios it should be considered an issue.

I suppose the component could have another property, say allowDuplicateValues, that would allow the behavior you relied upon in the older version, but admittedly that is not high priority right now.

Hello,
I would like to +1 this one and challenge the fact that it is considered an enhancement.
Actually being a change released in the same major, this one should be considered a regression as it contains non backward compatible changes.