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

SQFormDropdown can't handle displayEmpty and [] as children #449

Closed
20BBrown14 opened this issue Sep 28, 2021 · 0 comments · Fixed by #451
Closed

SQFormDropdown can't handle displayEmpty and [] as children #449

20BBrown14 opened this issue Sep 28, 2021 · 0 comments · Fixed by #451

Comments

@20BBrown14
Copy link
Contributor

Affected Components: at least SQFormDropdown

If you use give [] to SQFormDropdown as children (no options) and pass displayEmpty as true the whole thing blows up because of this line
https://github.com/SelectQuoteLabs/SQForm/blob/master/src/components/SQForm/SQFormDropdown.js#L68

We should use optional chaining on those .label reads

20BBrown14 added a commit that referenced this issue Sep 28, 2021
if `displayEmpty` was true and children is `[]` for SQFormDropdown then
we would get a "Unable to read property of undefined" error. Optional
chaining fixes that.

✅ Closes: #449
SeanGroff pushed a commit that referenced this issue Oct 5, 2021
### [5.6.1](v5.6.0...v5.6.1) (2021-10-05)

### Bug Fixes

* 🐛 Fix dropdown issue with empty children and displayEmpty ([e28b1b6](e28b1b6)), closes [#449](#449)
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

Successfully merging a pull request may close this issue.

1 participant