arfedulov/semantic-ui-calendar-react

onBlur is not working for all input types

Closed this issue · 3 comments

Describe the bug
It is common to have onBlur (when in form, you focus away from the input) event to fire, usually the payload is same as the onChange, but for form validation, where focusing away from an input generates an error if the field is required.

To Reproduce
Steps to reproduce the behavior:

  1. Go to any component'
  2. Add onBlur prop
  3. See error: Warning: Failed prop type: DateRangePicker: unknown props found: onBlur

Expected behavior
A onBlur event is fired.

  • semantic-ui-react
  • semantic-ui-css (or any alternative)
  • semantic-ui-calendar-react

Is there onBlur prop on semantic-ui-react's Input element? As far as I know there isn't, correct me if I'm wrong.

This module is build on top of semantic-ui-react and deals with only date-picker related stuff. Handling input events is a low level task for this module and it relies on semantic-ui-react in things like that.

Hi

I would like to use semantic-ui-calendar-react component in forms like React Final Form, but I cannot since field validation never occurs.
Form Field validation occurs when onBlur event is fired.

It seems that InputView::onBlur() only calls its internal "closePopup()" function here but does not forward onBlur event.

solved in #171