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

203
Visualizações
How To Make Antd Select Dropdown Anchor To Right Of Select

I use Ant-Design and in a component I have a Select which is placed to the right of the screen. Some of the labels are very long, and therefore when the dropdown appears, it overflows and a scrollbar appears. I would like to have the dropdown anchor to the right-hand side of the Select button rather than to the left-hand side, thus keeping the label length but avoiding the overflow without hiding anything, but Antd doesn't expose an API for doing this and I can't figure out which CSS property to mess with... An example Sandbox is here.

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

0

This is not described in the documentation, but since version 4.17.0 the Select supports the placement property.

export default function App() {
  const [value, setValue] = useState("short");

  return (
    <div
      className="App"
      style={{
        position: "relative"
      }}
    >
      <Select
        value={value}
        style={{
          position: "absolute",
          right: "20px"
        }}
        dropdownMatchSelectWidth={false}
        onChange={(v) => setValue(v)}
        placement={"bottomRight"}
      >
        <Select.Option value="short">Short</Select.Option>
        <Select.Option value="long">
          Really Long Label That Makes Everything Weird
        </Select.Option>
      </Select>
    </div>
  );
}

Link to changelog

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