Skip to content

inputProps.onChange is not called for DayPickerInput after selecting a day #750

@fc

Description

@fc

I would expect inputProps={{oChange: () => ...}} to be triggered after selecting a day.

Even looking through the code it definitely looks like it should be executed as can be seen here:
https://github.com/gpbl/react-day-picker/blob/master/src/DayPickerInput.js#L394

I suppose I would expect onChange would be triggered before onDayChange somewhere around here:
https://github.com/gpbl/react-day-picker/blob/master/src/DayPickerInput.js#L491

For now, I can accomplish it by using onDayChange + parseDate to get what I want done.

I did not see anyone else reporting this issue to me it seems like a bug or possibly by design.

And, unrelated to this but in the way I am dynamically creating this (I hook up validation in a separate centralized file allowing for dynamic form creation / validation), it would be nice if onDayChange also included the DayPickerInput props so I can use parseDate from there instead of having to know which parseDate is being used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions