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

Properly remove window event listener when unmounting component preview #4820

Merged
merged 2 commits into from
Mar 8, 2022

Conversation

aptkingston
Copy link
Member

Description

This PR fixes an issue reported in #4797 (comment). Thanks to @GlitchWitch for providing a video which helped me diagnose the issue.

We weren't properly removing an event listener when unmounting the component preview, which mean that if you toggled between the data and design section multiple times, new listeners would be created. This meant that whenever an even was sent from the iframe, it was handled multiple times. This causes lots of conflicts, and may have been the source of multiple other bugs as well.

@codecov-commenter
Copy link

Codecov Report

Merging #4820 (6e439c7) into master (01e97b0) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4820   +/-   ##
=======================================
  Coverage   67.91%   67.91%           
=======================================
  Files         144      144           
  Lines        4922     4922           
  Branches      761      761           
=======================================
  Hits         3343     3343           
  Misses       1105     1105           
  Partials      474      474           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 89e4c59...6e439c7. Read the comment docs.

Copy link
Member

@shogunpurple shogunpurple left a comment

Choose a reason for hiding this comment

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

LGTM!

@aptkingston aptkingston merged commit 2f23ef3 into master Mar 8, 2022
@aptkingston aptkingston deleted the fix/preview-event-callbacks branch March 8, 2022 08:44
@github-actions github-actions bot locked and limited conversation to collaborators Mar 8, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants