Skip to content
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

Merged
merged 3 commits into from
Jan 4, 2018
Merged

OverlayMask onClick error #261

merged 3 commits into from
Jan 4, 2018

Conversation

nreese
Copy link
Contributor

@nreese nreese commented Jan 4, 2018

fixes #260

Do not add event handlers to dom element with setAttribute method. Instead, add directly to dom element properties.

@nreese nreese requested review from cjcenizal and snide January 4, 2018 01:32
Copy link
Contributor

@snide snide left a 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.

Copy link
Contributor

@cjcenizal cjcenizal left a 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,
Copy link
Contributor

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);
Copy link
Contributor

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?

@nreese nreese merged commit 84dadc5 into elastic:master Jan 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OverlayMask onClick error
3 participants