primefaces / primefaces/primereact

TreeSelect does not include its value in form formData

Open
#8,220 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Status: Needs Triage
Dominant language
CSS
Stars
8.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

The TreeSelect component's selected value is not being included in the form's formData when the form is submitted. This prevents its value from being retrieved with formData.get('name'), making it unusable for standard form submissions.

Reproducer

https://stackblitz.com/edit/vitejs-vite-b2hhqpew?file=src%2FApp.tsx

  1. Select an item from the TreeSelect component.
  2. Click the "Submit" button.
System Information
Environment

primereact: 10.9.7
react: 19.1.1
Expected Behavior

When the form is submitted, the TreeSelect component should contribute its value to the form's formData object. The formData.get('name') method should return the value of the selected node.

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 StackBlitz reproducer's src/App.tsx and run the form submission after selecting a TreeSelect item. Trace the TreeSelect form submission path to determine why formData.get('name') lacks the selected value. Done means the selected node value is included in the form's formData and can be retrieved with formData.get('name').

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.