react-component / react-component/select

tokenSeparators - usage consulting

Open
#450 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
938
Forks
482
Avg merge
15h 8m
Merged PRs (30d)
2

Description

My data looks like the following

[
   {
      value: 1001,
      label: 'a name'
   }
]

I hope that after the user selects, the label will be displayed, and the user filter will also target the label, but I want automatically select these options when entering 1001,1002. What should I do?

https://github.com/react-component/select/blob/947185f7bfc8c7f09e1d107b868287f50be0cb2c/src/generate.tsx#L352-L355

When optionLabelProp is not set, mergedOptionLabelProp takes label by default .
But I need mergedOptionLabelProp to be value while optionLabelProp is still label.

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 src/generate.tsx at the referenced lines and trace how optionLabelProp becomes mergedOptionLabelProp. Check how selected labels, filtering, and comma-separated input are handled for options with numeric values. Done means the requested label display and filtering remain intact while entering values such as 1001,1002 selects the corresponding options.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
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.