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

addResizeListener bug #1600

Closed
Rich-Harris opened this issue Jul 18, 2018 · 3 comments
Closed

addResizeListener bug #1600

Rich-Harris opened this issue Jul 18, 2018 · 3 comments
Labels

Comments

@Rich-Harris
Copy link
Member

It's possible (albeit unusual) for this line to run before win has been set

@ekhaled
Copy link
Contributor

ekhaled commented Jul 18, 2018

This bug hit me yesterday... During a demo no less.
In my case I was destroying a component too quickly after it was instantiated, using a <svelte:component>

Rich-Harris added a commit that referenced this issue Jul 24, 2018
@ekhaled
Copy link
Contributor

ekhaled commented Aug 8, 2018

@Rich-Harris this still happens on iOS. However, in a slightly different form.

The <Object> gets removed by the parent on destroy, and win sticks around in this form:
screen shot 2018-08-08 at 17 01 08

It's like a weird object that looks like Window but has no removeEventListener method in it.

Are you open to fixing it like this:

- win && win.removeEventListener('resize', fn);
+ win && win.removeEventListener && win.removeEventListener('resize', fn);

if so I can send a PR your way

@Rich-Harris
Copy link
Member Author

o_O

the sheer weirdness of iOS Safari bugs never ceases to astound me. That seems like a reasonable fix, yes — a PR would be great, thank you

ekhaled added a commit to ekhaled/svelte that referenced this issue Aug 9, 2018
Rich-Harris added a commit that referenced this issue Aug 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants