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

Bug Report : Improper input handling for Allotted hours in the Create Action Item modal #3368

Open
yugal07 opened this issue Jan 20, 2025 · 1 comment
Assignees
Labels
bug Something isn't working invalid This doesn't seem right

Comments

@yugal07
Copy link

yugal07 commented Jan 20, 2025

Describe the bug
When entering non-numeric characters in the allotted hours input field, the field value becomes NaN (Not a Number) and remains stuck in this state. Once NaN appears, the field cannot be cleared or updated with new values, even when attempting to backspace or enter valid numbers. This creates a blocking user experience where the only way to recover is to refresh the form.
To Reproduce

Steps to reproduce the behavior:

  1. Login as a admin or superadmin
  2. Navigate to action items
  3. Try to create a action item
  4. type a letter in the allotted hours section.

Expected behavior

1.When non-numeric characters are entered, the field should either prevent the input or maintain its previous valid value
2.Users should be able to clear the field and enter new values at any time
3.The field should never display NaN to end users
4.Invalid inputs should be handled gracefully without getting the field stuck in an unrecoverable state

Actual behavior

1.Entering a letter or non-numeric character causes the field value to become NaN
2.Once NaN appears, the field becomes unresponsive to new inputs
3.Backspace and delete operations fail to clear the NaN value
4.The field remains stuck in an invalid state until form refresh

Screenshots

Image

Additional details
Root cause appears to be in the handleFormChange function where NaN values are being stored in the form state without proper validation. The current implementation doesn't properly sanitize numeric inputs before updating the state, leading to this persistent error state.

I have resolved this error on my local machine and am ready to raise a PR for this.

Potential internship candidates

Please read this if you are planning to apply for a Palisadoes Foundation internship

@yugal07 yugal07 added the bug Something isn't working label Jan 20, 2025
@github-actions github-actions bot added invalid This doesn't seem right unapproved labels Jan 20, 2025
@yugal07
Copy link
Author

yugal07 commented Jan 20, 2025

Please assign this to me since I have resolved this on my local machine and am ready to raise a PR. @palisadoes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants