Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

145
Views
React Select abreviate dropdown names on multi select

Hi is it possible to abbreviate dropdown names when selected like the figure below enter image description here

this is my code :

          multiValue: [
            { value: "BUF", label: "BUF" },
            { value: "CCT", label: "CCT" },
            { value: "JHB", label: "JHB" },
            { value: "EKH", label: "EKH" },
            { value: "ETK", label: "ETK" },
            { value: "MAN", label: "MAN" },
            { value: "NMB", label: "NMB" },
            { value: "TSH", label: "TSH" }
          ],
      handleMultiChange(option) {
        this.setState({multiValue: option}); 
}
                  <Select
                    id='multiple'
                    name="filters"
                    placeholder="Filter City"
                    value={this.state.multiValue}
                    options={this.state.filterOptions}
                    onChange={this.handleMultiChange}
                    isMulti={this.state.isMulti}
                    styles={style}
                  />
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You could accomplish this by providing a custom MultiValueLabel component

MultiValueLabel.component.js

export default function MultiValueLabel({
  data,
  innerProps,
  selectProps
}) {
  // ...any logic you might need
  // 'data' should be the full object of each selected item
  // so reference whatever key is necessary
  return (
    <div {...innerProps}>
      {data.abbr}
    </div>
  )
}

Then you just pass that in

<Select
  components={{
    MultiSelectLabel
  }}
  ... other props
/>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!