Skip to content

Conversation

@SayakaOno
Copy link
Collaborator

Description

Use setValueAs to trim input and prevent whitespace-only values from bypassing "required" validation.
(I cleaned up supplier validation together)

Screenshot 2025-10-08 at 9 42 12 AM

(https://react-hook-form.com/docs/useform/register)

Note:
The same issue likely exists elsewhere. (I tested field work task creation with an empty new filed work type, and the API returned an error)

Jira link: https://lite-farm.atlassian.net/browse/LF-4983

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

  • Passes test case
  • UI components visually reviewed on desktop view
  • UI components visually reviewed on mobile view
  • Other (please explain)

Checklist:

  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • The precommit and linting ran successfully
  • I have added or updated language tags for text that's part of the UI
  • I have ordered translation keys alphabetically (optional: run pnpm i18n to help with this)
  • I have added the GNU General Public License to all new files

@SayakaOno SayakaOno self-assigned this Oct 8, 2025
@SayakaOno SayakaOno requested review from a team as code owners October 8, 2025 17:05
@SayakaOno SayakaOno requested review from Duncan-Brain and removed request for a team October 8, 2025 17:05
@SayakaOno SayakaOno added the bug Something isn't working label Oct 8, 2025
Copy link
Collaborator

@Duncan-Brain Duncan-Brain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Should we make a ticket for others?

@Duncan-Brain Duncan-Brain added this pull request to the merge queue Oct 8, 2025
Merged via the queue into integration with commit f9bc52e Oct 8, 2025
5 checks passed
@SayakaOno
Copy link
Collaborator Author

Thank you Duncan! I'll ask Denis to create a ticket 😁

@SayakaOno SayakaOno deleted the LF-4983/An_Error_is_displayed_when_saving_product_with_Name_consisting_only_of_spaces branch October 8, 2025 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants