-
Notifications
You must be signed in to change notification settings - Fork 843
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
[EuiFlyout] onClose
invoked with unexpected parameter
#2894
Comments
@pickypg Can you please explain the issue or how can I reproduce this. |
Something along the lines of: onComplete(data?: object) {
if (data) {
console.log('This also fires for certain uses of [onClose]');
} else {
console.log('As does this [onClose]');
}
}
render() {
return (
<EuiFlyout
onClose={this.onComplete}
ownFocus
// ...
/>
);
} When pressing the close button, it will pass the event data through to |
@pickypg can I work on this? |
Update: |
We do need to makes some changes here.
The second option requires making to changes to EuiOverlayMask, so I'd likely opt for the first option. |
onClose
invoked with unexpected parameter
The definition for
onClose
as part ofEuiFlyout
is() => void
. I was taking advantage of this by having my not-close button invoke the same method with an optional parameter.However, I was surprised when certain closure's were triggering issues in my code. Upon inspection, it kind of became clear that I was receiving the events from the button clicks:
eui/src/components/flyout/flyout.tsx
Line 100 in 070acd1
This is easy to workaround: just pass in the function as
() => actualCallback()
, but it was definitely unexpected.The text was updated successfully, but these errors were encountered: