react-component / react-component/tree

Disable child checkbox when parent checkbox Selected

Open
#465 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.3k
Forks
490
Avg merge
3d 17h
Merged PRs (30d)
5

Description

Requirement: I need to disable children checkboxes if the respective parent checkbox is selected & on uncheck the parent, children should get enabled with unchecking.

Issue: On-check function, I have managed to disabled the children's checkboxes but while making parent uncheck, children nodes checkboxes get enabled and the I have to re-click on the parent to make the uncheck.

Cause: I tried to debug this issue and as per my findings, There is a class conductUtil.ts with a function "CleanConductCeheck" which doesn't let child checkboxes key remove if disabled(Image attached below):
image
Because of which, inside on-check function I get array with all the keys(below code) even after unchecking.
image

Attempt: I tried to fork the repository and made changes then tried to install the forked repo to my project. But there, it is not adding dependencies of es and lib folder and just adding assets with few other files like package and license files.

Please help me with installing the forked repository or fix within my code.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in _conductUtil.ts at the CleanConductCeheck function, then trace the on-check behavior for a selected parent and its disabled children. Reproduce the check and uncheck sequence described in the issue; done means child checkbox keys are removed when the parent is unchecked and the children become enabled without a second parent click.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.