daltonmenezes / use-exit-intent

🐠 A React Hook to handle exit intent strategies
https://use-exit-intent.daltonmenezes.com
MIT License
83 stars 6 forks source link

Exit intent Fires on Input AutoComplete suggestions mouse hover #4

Open brzane opened 1 year ago

brzane commented 1 year ago

I'm facing a problem with the exit intent hook that when the user clicks on an input and tries to select from the browser autoComplete suggestions it fires , i want it to fire only when he tries to move outside the page , it seems that it the hook treats the autoCompelete as outside the page

daltonmenezes commented 1 year ago

Hi @brzane , could you please provide a reproducible example? Also, what browser are you testing?

danielrmartins commented 1 year ago

For me too, in Google Chrome. When the browser suggests autoComplete on the input

daltonmenezes commented 1 year ago

@danielrmartins what's your operating system?

danielrmartins commented 1 year ago

Linux - Ubuntu

danielrmartins commented 1 year ago

On Windows, this issue doesn't occur 🎉

daltonmenezes commented 1 year ago

@danielrmartins @brzane I believe this is an OS thing and how they deal with windows and elements like autofill popups and etc treating them like something outside the main window focus, so when the focus came back to the main window the hook fire!

Perhaps this is an unsolved case, the reason: #1

If anyone has a viable way to solve it so as not to break what was solved on #1, please, I'll be grateful if you send a PR. 💜

danielrmartins commented 1 year ago

Unfortunately, this problem occurs in Windows OS too

daltonmenezes commented 1 year ago

@brzane @danielrmartins Here it is working as expected!

https://github.com/daltonmenezes/use-exit-intent/assets/1149845/0d771247-4661-4c27-b29a-36f43e6f1eb4