I recently encountered an issue while implementing a dropdown menu in my React application. Everything was functioning smoothly until I attempted to change the browser resolution through the console.
// index.js:
<select
id="project_type"
name="project_type"
className="dropdown_menu"}
>
<option value="Yes">
Yes
</option>
<option value="No">
No
</option>
</select>
css file:
.dropdown_menu {
position: absolute;
width: 590px;
height: 48px;
background: rgba(0, 50, 160, 0.1);
margin-top: 270px;
border-radius: 5px;
border: 1px solid rgba(46, 81, 158, 0.6);
padding-left: 23.33px;
padding-top: 0;
}
Upon changing resolutions, this issue emerged:
https://i.sstatic.net/FXaCF.png
I am seeking advice on how to modify the dropdown menu so that its width matches that of its options, preventing overflow when resolutions are changed.
Note: I have tried setting 'width: inherit' but it did not resolve the issue.