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

Fix #7323: Clear timer in InputNumber component on unmount #7325

Merged
merged 2 commits into from
Oct 10, 2024

Conversation

tnowad
Copy link
Contributor

@tnowad tnowad commented Oct 10, 2024

Fixed

Fix #7323

This pull request fixes issue #7323, where the InputNumber component would enter an infinite loop when unmounted due to a forgotten timer cleanup.

Solution

The fix adds a cleanup function inside a useEffect hook to ensure that any active timers are cleared when the component unmounts.

Before:

Screen-Recording.1.online-video-cutter.com.1.mp4

After:

Screen-Recording.1.online-video-cutter.com.2.mp4

Copy link

vercel bot commented Oct 10, 2024

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

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
primereact ⬜️ Ignored (Inspect) Visit Preview Oct 10, 2024 0:48am
primereact-v9 ⬜️ Ignored (Inspect) Visit Preview Oct 10, 2024 0:48am

@tnowad tnowad requested a review from melloware October 10, 2024 12:52
@melloware melloware merged commit f2edb0d into primefaces:master Oct 10, 2024
4 checks passed
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.

InputNumber: Infinite Loop When Unmount Component
2 participants