Feat/2595 input validation radio#2537
Conversation
|
There was a problem hiding this comment.
Code Review
This pull request introduces a clear method to radio and radio-group components and implements a comprehensive validation system for handling touched states and form submissions, alongside a refactor of React component type definitions. The review feedback identifies necessary corrections to validation logic to ensure group states update correctly and recommends using the component's public API to avoid unintended side effects. Further improvements were suggested for type safety and preventing stale validation classes. Additionally, the new public methods and properties are missing the JSDoc @SInCE tags required by the repository style guide.
|



💡 What is the current behavior?
There are some errors which prevent validations from happening as expected.
GitHub Issue Number: #1799
JIRA: IX-2595
🆕 What is the new behavior?
The acceptance criteria for this ticket has been met for radio component:
Required input:
Invalid input > Removing value with keyboard > Stays invalid
Invalid input > Remove touched state (e.g. clear button) > Valid again
Invalid input > Programmatically setting it to empty > Stays invalid
Valid input > Removing value with keyboard > It is invalid
Valid input > Remove touched state (e.g. autoclear button) > Valid
Valid input > Programmatically setting it to empty > It is invalid
Not required input:
Invalid input > Removing value with keyboard > Valid
Invalid input > Remove touched state (e.g. clear button) > Valid again
Invalid input > Programmatically setting it to empty > Valid
Valid input > Removing value with keyboard > Valid
Valid input > Remove touched state (e.g. clear button) > Valid
Valid input > Programmatically setting it to empty > Valid
Also form 'novalidate' cases is handled.
🏁 Checklist
A pull request can only be merged if all of these conditions are met (where applicable):
pnpm test)pnpm lint)pnpm build, changes pushed)👨💻 Help & support