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

[NNotepad] Fix #253 e.target.close is not a function error #254

Merged
merged 2 commits into from
Jun 21, 2024

Conversation

ibelem
Copy link
Contributor

@ibelem ibelem commented Jun 19, 2024

Fix #253

Click "Close" button in "Show generated code" or "Show documentation" dialog not only triggers button click event but also the dialog click event, which makes the e.target in dialog click event quals the dialog element and button element, but there is no close() method for buttons.

@inexorabletash @anssiko @Honry PTAL

Copy link
Collaborator

@Honry Honry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Copy link
Member

@inexorabletash inexorabletash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine, but I think you could also do if (e.target !== dialog) return;

Sorry about this - obviously I added the "click outside to close" later and didn't test that the buttons still worked.

@ibelem
Copy link
Contributor Author

ibelem commented Jun 19, 2024

Thanks @inexorabletash , if (e.target !== dialog) return; is much more concise and precise, PTAL.

Copy link
Member

@inexorabletash inexorabletash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM thanks!

@Honry Honry merged commit 9c37259 into webmachinelearning:master Jun 21, 2024
3 checks passed
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.

[NNotepad] e.target.close is not a function when click close button in generated code and help dialogs
3 participants