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

200
Views
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 answers
Answer question

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 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!