govuk-react-jsx icon indicating copy to clipboard operation
govuk-react-jsx copied to clipboard

Consider onBlur, onInput and other form field specific events for DateInput, Radios and Checkboxes

Open andymantell opened this issue 5 years ago • 0 comments

Consider onBlur, onInput and other form field specific events for DateInput, Radios and Checkboxes. Since these components are effectively "compound" fields, we don't by default spread the top level props into the individual inputs (Since they are built from the items prop). This means that putting top level onBlur handlers in doesn't actually work. onChange works because I have specifically catered for this, but we should consider other events.

People can inject them via the individual items, but I think it would be cleaner not to require people to go to this extra effort.

Note: Make sure that any handlers specified on the individual items aren't wiped out by the top level one (i.e. insert the top level one and spread the individual item attributes afterwards)

andymantell avatar Jan 17 '20 16:01 andymantell