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

fix: overlay mask onClick been called multiple times #257

Conversation

ruanyl
Copy link
Member

@ruanyl ruanyl commented Jan 29, 2023

The cause:
click event listener is not properly unsubscribed

Signed-off-by: Yulong Ruan ruanyl@amazon.com

Description

The issue:
The onClick event handler will be called multiple times if the onClick instance changed among different rendering.

Here is branch to reproduce it: main...ruanyl:oui:overlay-mask-bug-reproduce
You can find the onClick function is called the same times as the times the button been clicked.

Issues Resolved

[List any issues this PR will resolve]

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • All tests pass
    • yarn lint
    • yarn test-unit
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

For more information on following Developer Certificate of Origin and signing off your commits, please check here.

The cause:
`click` event listener is not properly unsubscribed

Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
@ruanyl ruanyl requested a review from a team as a code owner January 29, 2023 06:08
Copy link
Contributor

@BSFishy BSFishy left a comment

Choose a reason for hiding this comment

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

This looks great! Thanks for the contribution. We're still working on developer guidelines, but ideally next time an issue is opened before a PR is raised :)

@ananzh ananzh merged commit b945c86 into opensearch-project:main Feb 28, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Feb 28, 2023
The cause:
`click` event listener is not properly unsubscribed

Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
Co-authored-by: Anan Zhuang <ananzh@amazon.com>
(cherry picked from commit b945c86)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
seanneumann added a commit that referenced this pull request Feb 28, 2023
The cause:
`click` event listener is not properly unsubscribed



(cherry picked from commit b945c86)

Signed-off-by: Yulong Ruan <ruanyl@amazon.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Anan Zhuang <ananzh@amazon.com>
Co-authored-by: Sean Neumann <1413295+seanneumann@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants