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

291
Visualizações
Make React Select horizontally scrollable on overflow

How can I make a React Select (specifically multiselect) component be able to scroll horizontally when the box overflows? I've tried

<Select
    // some other props
    styles={{
      valueContainer: (base) => ({
        ...base,
        overflowX: 'scroll',
      }),
    }}
    isMulti
/>

but that does not work. I am using React and Tailwind CSS.

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

I am not sure this will work, and it's also a bit hacky:

styles={{
      valueContainer: (base) => ({
        ...base,
        overflowX: 'scroll',
        flexWrap: 'unset',
      }),
      multiValue: (base) => ({
        ...base,
        flex: '1 0 auto',
      })
    }}

Please note that this will introduce new problems with scrollbars - on windows I assume the scrollbars will be visible permanently and mess with the layout, while on a Mac, the scrollbars will only appear while scrolling but then hide most of the content of the select value container.

about 4 years ago · Juan Pablo Isaza Relatório

0

If you are using Tailwind CSS then you can simply add the className='overflow-x-scroll' to enable horizontal scrolling.

<Select
    // some other props
    styles={{
      valueContainer: (base) => ({
        ...base,
        overflowX: 'scroll',
      }),
    }}
    isMulti
    className='overflow-x-scroll'
/>
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