-
Notifications
You must be signed in to change notification settings - Fork 842
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
OverlayMask onClick error #261
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.
Thanks for the quick fix. This addressed the functional error I saw. No idea if this is the best way to handle it, but it works. I'll leave that to @cjcenizal to review.
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.
LGTM, just had a couple small suggestions.
@@ -15,6 +15,7 @@ export class EuiOverlayMask extends Component { | |||
const { | |||
className, | |||
children, // eslint-disable-line no-unused-vars | |||
onClick, |
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.
Can we add this to propTypes
?
@@ -23,7 +24,13 @@ export class EuiOverlayMask extends Component { | |||
'euiOverlayMask', | |||
className | |||
); | |||
if (onClick) { | |||
this.overlayMaskNode.addEventListener('click', onClick); |
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 we also removeEventListener
in componentWillUnmount
?
fixes #260
Do not add event handlers to dom element with setAttribute method. Instead, add directly to dom element properties.