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

InteractiveGroup: Add disconnect(). #29975

Merged

Conversation

bbsimong
Copy link
Contributor

Description

Noticed this when messing with the InteractiveGroup utility. The event listeners are bound in the listenTo methods, but they're not removed when the group is removed from the scene. I added a disconnect method which does this explicitly.

As there's a stopPropagation in the onPointerEvent, adding an interactive group to the scene and removing it later would prevent any of the pointer event listeners firing that were bound earlier.

@Mugen87
Copy link
Collaborator

Mugen87 commented Jan 4, 2025

I have slightly refactored the PR since it contained JS syntax that breaks our current ESLint settings (we stick to ECMA 2018 atm).

Would the updated code work for you?

@Mugen87 Mugen87 changed the title fix: disconnect event listeners in InteractiveGroup InteractiveGroup: Add disconnect(). Jan 4, 2025
@bbsimong
Copy link
Contributor Author

bbsimong commented Jan 6, 2025

I have slightly refactored the PR since it contained JS syntax that breaks our current ESLint settings (we stick to ECMA 2018 atm).
Would the updated code work for you?

Thank you, happy with the changes

@Mugen87 Mugen87 added this to the r173 milestone Jan 6, 2025
@Mugen87 Mugen87 merged commit 4b2119b into mrdoob:dev Jan 6, 2025
11 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.

2 participants