-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[RAC] <RadioGroup />
displays validation result in realtime when validate()
is used
#6096
Comments
Possibly related #5693 |
@snowystinger Yes they are. I have also noticed, that an individual Same goes for the Seems like there is a bit of cleanup to do in the radio hooks, but unsure whats required to stay for backwards compatibility. Fixing the commit issue without introducing breaking changes to |
@snowystinger If i understand #6079 (comment) correctly, then this issue should be closable. It might make sense to adjust the docs slightly to inform developers of the different behavior of react-spectrum/packages/@react-types/shared/src/inputs.d.ts Lines 35 to 40 in 64ed130
|
I've built a select box with useSelect() hook and it shows also the validation message before the user clicked submit. All other form fields like text inputs do not do this, so it's very confusing. |
Provide a general summary of the issue here
When using
validate()
on a<RadioGroup />
, the validation result is displayed in realtime. This behavior is inconsistent with the docs ofvalidate()
and also with the validation behavior of<CheckboxGroup />
.🤔 Expected Behavior?
Either
<RadioGroup />
should display its validation result on submit or the docs need adjustment.😯 Current Behavior
An invalid validation result is displayed in realtime.
💁 Possible Solution
Without much investigation, my bet is on this line being the culprit:
react-spectrum/packages/@react-stately/radio/src/useRadioGroupState.ts
Line 79 in 9d37e24
I am not entirely sure why we need to commit here. I've looked at the original PR which introduced this line, but it seemed to have made it past review. Maybe @devongovett can help here with further insight.
🔦 Context
No response
🖥️ Steps to Reproduce
Version
latest
What browsers are you seeing the problem on?
Chrome
If other, please specify.
No response
What operating system are you using?
OSX
🧢 Your Company/Team
No response
🕷 Tracking Issue
No response
The text was updated successfully, but these errors were encountered: