Skip to content

RadioGroup onBlur event prop #5332

@fmfx-nickaspinall

Description

@fmfx-nickaspinall

Provide a general summary of the feature here

The RadioGroup component has an onChange event prop but no onBlur event prop, which makes validation rather tricky for this component.

🤔 Expected Behavior?

Provide an onBlur event prop for RadioGroup and call the handler with the event bubbled from the focussed Radio input when the native blur event is dispatched.

😯 Current Behavior

No blur event is bubbled from the Radio component

💁 Possible Solution

I have been able to work around this by using DOM selection techniques from the Radio component's onBlur handler, but this is awkward, messy and likely to break over time if the RadioGroup or Radio components DOM structure changes in the future. e.g.

const value = (parentNode?.parentNode?.parentNode.querySelector('input:checked') as HTMLInputElement)?.value ?? null;

🔦 Context

In my use case I need to validate form fields as the user tabs through the form even if no change has been made, therefore I'm relying on onBlur being available in RadioGroup like it is with other top-level form field components.

💻 Examples

No response

🧢 Your Company/Team

No response

🕷 Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions