Repository navigation
Aditya Dhayapulay - Hotfix: Prevent profile hours from changing while scrolling - #5654
Merged
Merged
Conversation
Blur focused profile-hour inputs on wheel so scrolling toward Save does not accidentally change the entered value. Preserve normal page scrolling and intentional keyboard edits. Add regression tests for weekly, make-up, intangible and category hours, read-only access, boundaries and mocked save payloads. Task: Hotfix Profile Hours Change/Edit Causes Wrong Updates
✅ Deploy Preview for highestgoodnetwork-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
shubhamjakhete
approved these changes
Oct 19, 2026
shubhamjakhete
left a comment
Contributor
There was a problem hiding this comment.
Checked out the PR at f795f71 and ran the frontend tests.
- Branch merges cleanly with the latest development.
- VolunteeringTimeTab.hours.test.jsx: 11/11 passing, and the existing
VolunteeringTimeTab tests still pass (25/25 in the folder).
- All UserProfile tests pass (338 passed, 3 skipped).
- The change is limited to adding onWheel={blurHoursOnWheel} to the four hours inputs.
Approving.
AaditTrivedi
approved these changes
Oct 21, 2026
AaditTrivedi
left a comment
There was a problem hiding this comment.
Reviewed by Aadit Trivedi.
Checked out the PR (no conflicts with development) and ran VolunteeringTimeTab.hours.test.jsx: 11/11 passing.
Verified
- The hours number inputs on the Volunteering Time tab now blur on mouse wheel (
onWheel={blurHoursOnWheel}), so scrolling while one is focused no longer steps its value. Blurring instead of cancelling the event lets the page keep scrolling toward Save. - The handler is applied to each hours input, and the tests cover scrolling over a focused field and saving.
Approving.
rahulrubugunday
approved these changes
Oct 24, 2026
rahulrubugunday
left a comment
There was a problem hiding this comment.
I have reviewed your PR locally (f795f71, backend on development) and it works as per requirement.
- Profile > Volunteering Times: typed 21 in Weekly Committed Hours and scrolled with the cursor over the field. The value stays 21, the field loses focus and the page scrolls.
- Same for a category hours field (Education stays 9 after scrolling).
- Readable in dark and light mode. npx vitest run src/components/UserProfile/VolunteeringTimeTab: 25/25 pass. No conflicts with development.
Member
|
Thank you all, merging! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Fix Hotfix Profile Hours Change/Edit Causes Wrong Updates.
Scrolling while a profile's hours field is focused can change the number before Save is clicked. For example, entering 21 hours can become 20, and Save then sends 20. This PR prevents scrolling from changing hours while keeping normal page scrolling and keyboard editing.
Reported examples: Video 1, Video 2.
Related PRS (if any):
None. Frontend only; no backend or API changes required for this fix. Separate from the job-application terms checkbox PR #5651.
Main changes explained:
How to test:
Use an isolated local backend/database or mocked requests. Do not edit production or shared-development volunteer records for testing.
fix/profile-hours-scrolland start the existing local setup.Validation completed:
Screenshots or videos of changes:
Four code/UI/evidence screenshots and a short captioned walkthrough are prepared locally for the weekly submission. They are not attached to this PR yet.
Note:
The Chromium reproduction uses a no-op, non-cancelling wheel listener to activate native number-input stepping; without that condition, the isolated page does not reproduce the decrement. Before the fix, the browser changed 21 to 20 and the mocked save sent 20. After the fix, it keeps 21 and allows scrolling.
Authenticated full-dashboard browser testing, real database persistence, other browsers and physical-trackpad testing remain unverified. No shared data was changed. No CSS, dependencies or backend files were modified. An unfiltered test run includes old ignored PR-review fixtures and is not green; the source-suite results above exclude those unrelated fixtures.