Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

137
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda