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

Remove Listener Issue #142

Closed
renato-mauro opened this issue May 19, 2023 · 4 comments
Closed

Remove Listener Issue #142

renato-mauro opened this issue May 19, 2023 · 4 comments

Comments

@renato-mauro
Copy link

Hello! Thanks for your work. Helped me a lot. There is a small issue when you are removing the event listener for window focus. As it was registered with useCapture = true, it should be unregistered using also useCapture = true argument.

https://github.com/GoogleChromeLabs/browser-fs-access/blame/5d8a551af106121d010c1c50ca4a15d3cb0b189d/src/legacy/file-open.mjs#LL32

@tomayac
Copy link
Member

tomayac commented May 19, 2023

Thank you! Just released v0.34.0 that includes this fix.

@hshafie
Copy link

hshafie commented May 20, 2023

I'm sorry but I don't understand this change.
In v0.34.0, legacy/file-open.mjs, I see:

    input.addEventListener('click', () => {
      window.addEventListener('focus', cancelDetector);
    });

No useCapture=true third argument there (and useCapture defaults to false).

@tomayac
Copy link
Member

tomayac commented May 22, 2023

You're right. I didn't realize that the link went to outdated code. Sorry.

@hshafie
Copy link

hshafie commented May 23, 2023

No problem. Thank you for the quick response and of course, for your very useful library.

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

No branches or pull requests

3 participants