Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Select doesn't propagate undefined value set in option tag #47

Open
mcmxcdev opened this issue Mar 24, 2021 · 0 comments
Open

Select doesn't propagate undefined value set in option tag #47

mcmxcdev opened this issue Mar 24, 2021 · 0 comments

Comments

@mcmxcdev
Copy link

  • windmill-react-ui version: 0.5.0

Relevant code or config:

<Select
  className="relative flex items-center h-10 py-2 text-base text-black border border-gray-300 w-100"
  name="campaignType"
  onChange={handleCampaignTypeChange}
  >
  <option value={undefined}>{t('allCampaigns')}</option>
</Select>

What you did:

When using an option tag with value undefined, it is not captured in the onChange handler of <Select>.
Instead, the actual content of the option tag is passed to the <Select>.
When using an actual truthy value as option value, it is passed on correctly.

In the example code, using a fallback value of undefined is necessary though, since undefined will be used as a query param and only ignored as actual undefined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant