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

[EuiSelect] allow select's value to be reset with an undefined value #4428

Conversation

chandlerprall
Copy link
Contributor

@chandlerprall chandlerprall commented Jan 15, 2021

Summary

Closes #4427 by adding logic for EuiSelect[hasNoInitialSelection] to reset to its hidden empty option if it receives a value={undefined}.

Checklist

- [ ] Check against all themes for compatibility in both light and dark modes
- [ ] Checked in mobile

  • Checked in Chrome, Safari, Edge, and Firefox
    - [ ] Props have proper autodocs
    - [ ] Added documentation
  • Checked Code Sandbox works for the any docs examples
  • Added or updated jest tests
  • Checked for breaking changes and labeled appropriately
    - [ ] Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4428/

CHANGELOG.md Outdated Show resolved Hide resolved
src-docs/src/views/form_controls/select.js Outdated Show resolved Hide resolved
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4428/

Copy link
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM; tested locally by adding a method to set the value to undefined

Copy link
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4428/

@chandlerprall chandlerprall merged commit 8eff75d into elastic:master Jan 19, 2021
@chandlerprall chandlerprall deleted the feature/4427-euiselect-undefined-value branch January 19, 2021 20:33
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4428/

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 this pull request may close these issues.

[EUI] Setting the value to undefined does not select the blank option.
4 participants