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

✨ Reset popup auto-close timer on interaction with popup #1071

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

samrenfrew
Copy link

Proposed change

I noticed that the timer for auto-close does not reset on interaction with the popup, which sometimes causes the popup to close prematurely when I'm about to click a button. Looking at the code, it looks like this was meant to be implemented with context.resetCloseTimeout but this did not work.

This PR adds that functionality (including for click alongside touchstart so that this works on desktop devices), such that any interaction within the popup will reset the timer to it's configured value

Type of change

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

To test the change:

  • Set a popup timeout of 3000ms
  • Open popup
  • Click anywhere on the popup, including in nested cards. Keep clicking to delay the popup from closing
  • When interaction has stopped, count to 3 seconds and note the popup will close

Additional documentation needed.

N/A

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests screenshots/gifs have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

  • Documentation added/updated for readme.

@Clooos
Copy link
Owner

Clooos commented Dec 21, 2024

Hi! Thank you for this! This was the case before, but I should have broke that feature by refactoring the code.

I will add this in the next release!

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.

2 participants