react-component / react-component/tree

Ability to trigger check event during expand event

Open
#229 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

I have a dynamically-loading tree that doesn't load children until the parent is expanded. The fetch mechanism doesn't have enough information to tell the UI whether the node is an unexpanded intermediate node or a leaf node. Therefore in the UI I display both as an expandable node and update it after it is expanded.

This works well, with the exception of having to interact with leaf node twice to check it (once to expand it and realize it's not expandable, and second time to check the box). I would like to do this in one step, expand the node and if it's a leaf node then automatically check it as it's loaded. The problem is that I don't see a mechanism for triggering a check programmatically from within onExpand method.

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 by reviewing the tree component's onExpand handling and the existing expand and check event behavior. The change is done when expanding a dynamically loaded leaf can trigger its check action in the same interaction, without requiring a second user action.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.