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

Release dummy wheel listener on workspace dispose #7693

Conversation

ananta
Copy link
Contributor

@ananta ananta commented Dec 5, 2023

The basics

The details

Resolves

Fixes #7674

Proposed Changes

  • Introduced a new class member dummyWheelListener in WorkspaceSvg to store the dummy wheel event listener.
  • Modified the dispose method in WorkspaceSvg to remove the dummyWheelListener from the document body when the workspace is disposed.

Reason for Changes

Previously, the dummy wheel event listener added to the document as a workaround for a Safari bug was not being properly disposed of. This could potentially lead to memory leaks and unintended behavior. By storing the listener in a class member, we can ensure it is correctly removed when the workspace is disposed, thus improving the robustness and cleanliness of the code.

Test Coverage

  • Manually tested to confirm that the dummyWheelListener is added and removed correctly.
  • Ensured that the addition and removal of this listener have no side effects on the functionality of WorkspaceSvg.

Documentation

  • No major documentation updates required as these changes are internal and pertain to fixing a specific bug.

Additional Information

N/A

@ananta ananta requested a review from a team as a code owner December 5, 2023 04:41
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome! It looks like this is your first pull request in Blockly, so here are a couple of tips:

  • You can find tips about contributing to Blockly and how to validate your changes on our developer site.
  • All contributors must sign the Google Contributor License Agreement (CLA). If the google-cla bot leaves a comment on this PR, make sure you follow the instructions.
  • We use conventional commits to make versioning the package easier. Make sure your commit message is in the proper format or learn how to fix it.
  • If any of the other checks on this PR fail, you can click on them to learn why. It might be that your change caused a test failure, or that you need to double-check the style guide.
    Thank you for opening this PR! A member of the Blockly team will review it soon.

@ananta ananta force-pushed the release-dummy-wheel-listener-on-workspace-dispose branch from 0751918 to 5c4da68 Compare December 5, 2023 05:24
@BeksOmega BeksOmega assigned BeksOmega and unassigned NeilFraser Dec 5, 2023
@BeksOmega BeksOmega requested review from BeksOmega and removed request for NeilFraser December 5, 2023 16:15
Copy link
Collaborator

@BeksOmega BeksOmega 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 =) Thank you for the fix! Once CI passes I'll get this merged.

@BeksOmega BeksOmega merged commit 0836a1d into google:develop Dec 5, 2023
7 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.

Release wheel listener when disposing workspace.
3 participants