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

feat: mouseLeaveDelayInSeconds option for desktop #12

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

baodoan
Copy link

@baodoan baodoan commented Sep 6, 2024

  • Added mouseLeaveDelayInSeconds to the DesktopOptions interface
  • Implemented a timer to enable mouse leave detection after the specified delay
  • Updated the useEffect hook to handle the new behavior

This change helps prevent premature triggering of exit intent actions, especially useful for pages with longer load times or when users might accidentally move their mouse outside the window shortly after page load.

Example

const { settings, isTriggered, unsubscribe } = useExitIntent({
  desktop: {
    triggerOnMouseLeave: true,
    mouseLeaveDelayInSeconds: 5 // Start detecting mouse leave 5 seconds after page load
  }
})

Copy link

changeset-bot bot commented Sep 6, 2024

⚠️ No Changeset found

Latest commit: 417761c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Sep 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
use-exit-intent-web-prh5 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 4, 2024 2:12pm

@daltonmenezes
Copy link
Owner

Hi @baodoan , thanks. Could you please perform a git pull command and also update the docs with mouseLeaveDelayInSeconds property?

@daltonmenezes daltonmenezes self-requested a review September 13, 2024 00:22
@daltonmenezes daltonmenezes linked an issue Sep 13, 2024 that may be closed by this pull request
@baodoan baodoan changed the title Add mouseLeaveDelayInSeconds option for desktop exit intent feat: mouseLeaveDelayInSeconds option for desktop Oct 4, 2024
@baodoan
Copy link
Author

baodoan commented Oct 4, 2024

Thanks @daltonmenezes Just pulled and updated the PR.

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

Successfully merging this pull request may close these issues.

Delay for Modal Trigger on Desktop Mouse Leave
3 participants