pushtell/react-bootstrap-date-picker

onInvalid event handler not passed to input.

Closed this issue · 4 comments

hugo commented

Expected Behavior

When marking the DatePicker as required it should also be possible to attach an onInvalid event handler to handle custom validation when a date is not selected.

Current Behavior

When marking a field as required, the browser default validation handler runs.

Possible Solution

Pass through event handlers to the underlying InputControl

Context

We are using the DatePicker component in a complex form where overriding the browser default invalid behaviour is an important UX consideration. As the <DatePicker /> component doesn't allow us to override the onInvalid handler, it makes the form seem janky and unprofessional.

@hugo this is a community supported project. PRs are appreciated!

hugo commented

@wehriam great, if you're happy with the change I'm happy to make it.

Seems like a good idea to me.

hugo commented

Closed by #124