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

Unregister ResizeObserver for map container #397

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

chrismayer
Copy link
Collaborator

This unregisters the ResizeObserver for the map's container element, when the map is unmounted/destroyed.

Besides having a better cleanup this also removes the null pointer access within the ResizeObserver handler in the hot-reload of the dev- setup, when then WguApp.vue is changed.

Copy link
Collaborator

@fschmenger fschmenger left a comment

Choose a reason for hiding this comment

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

Nice catch, I have currently no time to test but totally makes sense.

For paranoia reasons I suggest to wrap up the disconnect with an
if (this.resizeObserver)
just in case container is undefined on registration.

This unregisters the ResizeObserver for the map's
container, when the map is unmounted/destroyed.
@chrismayer
Copy link
Collaborator Author

Thanks for your review @fschmenger!

I added the check if (this.resizeObserver), not just for paranoia 😉 - it was necessary to make the tests green. Here we exactly have the situation, that no container exists. Thanks for the hint!

@chrismayer chrismayer merged commit 3c9ee33 into wegue-oss:master Jun 6, 2024
1 check 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