-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[UI Framework] Add KuiOutsideClickDetector #13521
[UI Framework] Add KuiOutsideClickDetector #13521
Conversation
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.
awesome, lgtm
}, | ||
}); | ||
|
||
return cloneElement(this.props.children, props); |
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.
Whoops, sorry for missing the review request on this one. Looks good, though I think
return React.Children.only(this.props.children, child => cloneElement(child, props));
is still the best practice here (even if only for clearer error messaging to a future dev trying to use multiple children).
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.
Thanks!
* Add KuiOutsideClickDetector. * Convert KuiColorPicker and KuiPopover to use KuiOutsideClickDetector.
Fixes #13414
Inspired by https://github.com/elastic/kibana/pull/13383/files#diff-d92aa0fe7c9d4339904684fb15395a47R14