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

window.focus is triggered twice on Safari but only once in Firefox and Chrome #254

Open
mircealungu opened this issue Jul 25, 2023 · 1 comment

Comments

@mircealungu
Copy link
Member

must find a way to debounce this.

somebody else discovered this behavior long time ago: facebook/react#10871

seems to still be there.

@jippylong12
Copy link

Howdy,

I had a similar issue with the following code

items[i].onfocusout = function () {}

The focusout event is called twice only in Safari. My server would receive two requests and the UI would show a notifications after each request.

However, I updated the code to using the addEventListener function and it resolved my issue. Now Safari only triggers once.

items[i].addEventListener("focusout", function() {});

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

2 participants