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 duplicate iframes being created #97

Merged
merged 2 commits into from Nov 28, 2021
Merged

Fix duplicate iframes being created #97

merged 2 commits into from Nov 28, 2021

Conversation

codepuncher
Copy link
Contributor

Fixes #92

@paulirish
Copy link
Owner

paulirish commented Nov 28, 2021

@codepuncher thanks for hacking on this

also wow i really did not think this worked but.. turns out context doesnt work the way i thought it did. but yeah this is bueno.

Side note: as long as your event handler is a method of your custom element, there is no need to manually bind it. When calling addEventListener, the value of this inside the event handler is a reference to the element.

via https://open-wc.org/guides/knowledge/events/#on-your-elements

do you have an idea on why this fixes the duplicate iframe behavior?

@paulirish
Copy link
Owner

I added a lil dirty check here as well, just to toughen things up.

@paulirish paulirish merged commit cff0e53 into paulirish:master Nov 28, 2021
@codepuncher codepuncher deleted the patch-1 branch November 30, 2021 09:52
@codepuncher
Copy link
Contributor Author

codepuncher commented Nov 30, 2021

do you have an idea on why this fixes the duplicate iframe behavior?

Honestly, no. But I wish I did!

Thanks for merging.

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.

Duplicate Iframe/video player being added
2 participants