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 select same size as largest option in React?

I have a select and a Dropdown from the PrimeReact library, arranged as such:

<div>
<SelectComponent
/>
</div>

Inside SelectComponent:

<div>
<Dropdown
/>
</div>

The problem is that the Dropdown content renders far away from the container div, and so when I try to set the width of the parent div to width: min-content, it doesn't work, because they aren't actually related elements in the DOM.

How should I proceed then? I would preferentially like to do this in CSS only.

about 4 years ago · Juan Pablo Isaza
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!