I’m using HTML select in my react application. Whenever I open the page, the select shows no options on click like this:
When I searched for the reason, I couldn’t find anything. But sometimes the options are showing properly like this:
I don’t know why the HTML select is behaving like this.
This is my code part:
<select
id="partnerFilter"
autoComplete="Off"
className="block w-full overflow-clip rounded-lg border-0 bg-white/50 px-4 py-2 pr-5 text-sm text-gray-700 backdrop-blur-lg backdrop-brightness-110 focus:outline-none focus:ring-0 "
disabled={isPartner()}
value={options.selectedPartner}
onChange={(e) => {
changePartner(e.target.value)
}}
>
{partners.map((option, index) => (
<option
key={index}
value={option.partner}
>
{option.partner}
</option>
))}
</select>
You need to sign in to view this answers