-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
Add a Async Select that fetches options from given endpoint #1909
Conversation
672bb88
to
a08c487
Compare
wrapper.find('[name="select-user"]') | ||
.simulate('change', { value: 1 }); | ||
expect(wrapper.state().userId).to.equal(1); | ||
expect(wrapper.find(Select)).to.have.length(3); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this assert 3 or 4 selects? it was 4 before this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after we switched the user select to AsyncSelect it became 3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok cool. we should update the it
statement on L21 to read should have three selects
in that case.
render() { | ||
return ( | ||
<div> | ||
<Select |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do we show when the select is loading data?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isLoading is true when loading the data, Select will render a spinner
LGTM after updating the |
|
||
const defaultProps = { | ||
placeholder: 'Select ...', | ||
value: null, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think null
defaults are implicit.
Neat! This reusable component is super useful to have! |
6e42191
to
71232b6
Compare
38487c7
to
a2f7caf
Compare
Done:
UI stays the same as in old Select:
needs-review @ascott @mistercrunch @bkyryliuk