primefaces / primefaces/primereact

TreeSelect feature request

Open
#6,326 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Type: Enhancement
Dominant language
CSS
Stars
8.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Discussed in https://github.com/orgs/primefaces/discussions/1298

Originally posted by rdyava February 26, 2024
Hello all,

I am using the TreeSelect component and was wondering if there is a way to alter the behavior of the checkbox selection mode. Currently when there is a single child node of a parent node, with the checkbox selection mode enabled and selecting the child, it also checks the parent node as well. Is there a way to make it so that for this sort of use case, the parent node is not selected? For example, in the example in the documentation, selecting "Invoices.txt" also selects "Home", I would need "Home" to be a partially selected value in this case and not showing as a selection with "Invoices.txt".

image

The propogateSelectionUp and propogateSelectionDown props from the standard Tree component which modify the checkbox selection behavior are not present in the TreeSelect component. For my use case which I defined in the linked discussion, I would like these props to be made available in the TreeSelect component if possible.

Contributor guide

Open the contributing guide

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 with the TreeSelect component and compare its checkbox selection behavior with the standard Tree component's propogateSelectionUp and propogateSelectionDown props. Done means TreeSelect exposes the requested controls and selecting a sole child can leave its parent partially selected rather than selected, matching the described use case.

Written by the indexing model from the issue text.

Assessment

Tech stack
react
Domain
frontend
Issue type
Feature
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.