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

version 1.6.0 doesn't update State "checked" but version 1.5.1 does

nour-sidaoui opened this issue · comments

Tree items are rendered as "all-checked" and clicking their checkboxes doesn't change their state

I found that the example sandbox works perfectly fine (on version 1.5.1)
However, version 1.6.0 does recreate the bug.
CodeSandbox snippet (set on v1.5.1).

I've been trying to make that work on my local machine by copying / pasting the code and installing the exact same dependencies without success.

Please help!

finally solved it!
I had leaf-items (items that have no children) having an empty array as children:
children: []
I removed it and everything works fine... on all versions :)

@nour-sidaoui
That's too worked for me.
I was stuck for 2 hours and was not able to figure out the issue... Thanks for figuring it out.

Same here, thanks a lot.

If someone is doing something like this :
image

I was stuck on this for a while too! Removing empty children arrays fixed the checkbox issue for me.