Open AdamZajler opened 6 months ago
the codesandbox is not viewable
the codesandbox is not viewable
I updated the link ;)
Also I have updated the example because I found new error.
When you are filling the form => you submit it and validate data. If you set some custom errors in validation proces you cant set focus on checkbox BUT if you trigger error by just checking required checkbox and unchecking it OR by onClick with setError you can set focus :thinking:
It looks like setting custom erros is breaking smth
@AdamZajler what do you expect on a RadioGroup to be focused? I don't see any example of @MUI which is addressing this. I tried to programmatically use ref.current.focus() but this just doesn't do anything on the RadioGroup of @Mui, this might be just not implemented on their side?
@AdamZajler what do you expect on a RadioGroup to be focused? I don't see any example of @mui which is addressing this. I tried to programmatically use ref.current.focus() but this just doesn't do anything on the RadioGroup of @mui, this might be just not implemented on their side?
Huh you're right, I didn't think about it that way :sweat_smile: But what about this case for the checkbox after form submitting?
@sadik-malik you introduced the handleInputRef
functionality inside of Checkbox, do you know if there is anything missing in the current implementation?
@AdamZajler, regarding the checkbox focus functionality: The checkbox receives focus when you click the "agreement focus" button after submitting the form, but without the ripple effect. Try pressing the "space" bar on your keyboard after clicking the "agreement focus" button to see the focus.
The only issue is the missing ripple effect, which was raised a while ago in MUI #9659.
You can use the action
prop of the checkbox and call action.focusVisible()
along with control.setFocus()
to focus the checkbox with the ripple effect.
Duplicates
Latest version
Current behavior 😯
Currently
control.setFocus()
cannot be used; on theRadioButtonGroup
.Expected behavior 🤔
Focus on this element can be setted
Steps to reproduce 🕹
codesandbox
Form to embed