fix: Exit Intent now works on FF, Safari, Arc (#1059)

This commit is contained in:
Prasoon Mahawar
2023-10-10 16:02:41 +05:30
committed by GitHub
parent 85fe1feec6
commit 6fb61f1bfd

View File

@@ -14,7 +14,7 @@ let exitIntentListenerWrapper = async function (e: MouseEvent) {
export const addExitIntentListener = (): void => {
if (typeof document !== "undefined" && !exitIntentListenerAdded) {
document.addEventListener("mouseleave", exitIntentListenerWrapper);
document.querySelector("body")!.addEventListener("mouseleave", exitIntentListenerWrapper);
exitIntentListenerAdded = true;
}
};