react-checkbox-tree icon indicating copy to clipboard operation
react-checkbox-tree copied to clipboard

Duplicate value detected starting from version 1.7.3

Open SergioArrighi opened this issue 3 years ago • 2 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.

SergioArrighi avatar Aug 08 '22 14:08 SergioArrighi

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.

jakezatecky avatar Sep 06 '22 19:09 jakezatecky

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.

SergioArrighi avatar Nov 02 '22 13:11 SergioArrighi