react-accessible-treeview icon indicating copy to clipboard operation
react-accessible-treeview copied to clipboard

Wrong group node selection

Open urrri-redis opened this issue 1 year ago • 3 comments

Describe the bug

Selection of group nodes is different, depends on order of selectedIds

To Reproduce

  1. Go to Checkbox with controlled selectedIds
  2. Write following list of ids 12,13,14,15,8,9,10 to the IDs input and press "Set" button
  3. Node "Tea-11" is not selected, though all its children are.
  4. Change list of IDs to 8,9,10,12,13,14,15 and press "Set" button.
  5. All nodes are selected correctly.

Expected behavior Order of IDs should not change selection behavior. Group node should be always represent state of its children selection

Screenshots If applicable, add screenshots to help explain your problem. image

Desktop (please complete the following information):

  • OS: [Windows 10]
  • Browser [chrome]
  • Version [126]

urrri-redis avatar Jul 16 '24 15:07 urrri-redis

@urrri-redis are you experiencing this in your production application?

I ask because the IDs you set don’t seem like a real use case—like why would someone select everything underneath a branch but not just select the whole branch?

Either way, we’re open to PRs. This is a volunteer maintained open source repo.

dgreene1 avatar Jul 16 '24 15:07 dgreene1

@dgreene1 this is absolutely correct way to have selected ids for fully selected branch. There are 3 ways:

  • only leaves
  • only parents, if all leave are selected
  • both parents and leaves, if all leaves are selected

some trees allow choose the way to get selection ids, some allow to make it custom way, but all of them must understand all 3ways, when receive selection IDs, even if they are mixed

urrri-redis avatar Jul 18 '24 08:07 urrri-redis

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 16 '24 22:09 stale[bot]

This issue was closed automatically since it was marked as stale because it has not had recent activity. Thank you for your contributions.

stale[bot] avatar Sep 24 '24 01:09 stale[bot]