-
Notifications
You must be signed in to change notification settings - Fork 579
Closed
Description
Are you reporting a bug?
No.
Are you making a feature request?
Yes. Happy to PR it.
- Please describe your use case from user journey point of view, e.g.:
When user sees suggestions, for example show overlay around dropdown and label (or do something else crazy), when used doesn't see suggestions, hide overlay.
- If you have ideas how to extend the Autosuggest API to support your new feature, please share!
Add isOpen to component's state, make component accept onDropdownOpen and onDropdownClose callback functions and do state update
componentWillUpdate(nextProps, nextState) {
const {
onDropdownOpen,
onDropdownClose
} = this.props;
const { isFocused, isCollapsed } = nextState;
const willRenderSuggestions = this.willRenderSuggestions(this.props);
const isOpen =
alwaysRenderSuggestions ||
(isFocused && !isCollapsed && willRenderSuggestions);
if (this.state.isOpen != isOpen) {
this.setState({ isOpen });
if (isOpen) {
onDropdownOpen();
} else {
onDropdownClose();
}
}
Something like that.
sheltonial
Metadata
Metadata
Assignees
Labels
No labels