material-ui-datetimepicker icon indicating copy to clipboard operation
material-ui-datetimepicker copied to clipboard

onChange doesn't fire

Open jeromevvb opened this issue 7 years ago • 10 comments
trafficstars

Hello guys,

Hope you're doing well. Thanks for this nice component!

I just download this library and started to use but i realized a problem with the onChange method. My method setDatetime is not called :(

<DateTimePicker DatePicker={DatePickerDialog} TimePicker={TimePickerDialog} onChange={this.setDatetime} />

setDatetime = (datetime) => { console.log(datetime); }

Any errors in the console.. What happened?

i looked the material-ui-datepicker code and i saw you tried to fire up the onChange method inside SelectTime function but you the prop "onAccept" on material-ui timepicker but this props doesnt exist right? Please let me know if am doing something wrong! Thaaaaaaank you!!

jeromevvb avatar Nov 28 '17 11:11 jeromevvb

Oh god) I just little forgot about this project :sorry: I will try to fix that asap

dmtrKovalenko avatar Nov 29 '17 17:11 dmtrKovalenko

experiencing the same issue :)

alilland avatar Nov 30 '17 01:11 alilland

That was just strange) I republished previous build, try to install 1.0.4 and let me know if it was not fixed

dmtrKovalenko avatar Nov 30 '17 07:11 dmtrKovalenko

still the same issue =( @dmtrKovalenko

ThanksAndShareOffice avatar Nov 30 '17 10:11 ThanksAndShareOffice

So now I cannot fastly figure out whats going wrong. And I would not have time to look at that deeply near time, so if someone's facing issue and wanna open PR to fix it - you are welcome.

dmtrKovalenko avatar Nov 30 '17 10:11 dmtrKovalenko

@dmtrKovalenko I sent a pull request for this issue. I just removed the setState callback as a hotfix, as it works at selectDate as well. Later we can figure out why the setState callback does not work.

golya avatar Dec 11 '17 08:12 golya

@golya react version may be the cause of the callback bug. @dmtrKovalenko could you update the npm repository with the latest changes? it is still on the 1.0.4 version and using setState with the callback

AleVul avatar Dec 12 '17 10:12 AleVul

I have. 1.0.5 is already available

dmtrKovalenko avatar Dec 12 '17 10:12 dmtrKovalenko

It doesn't fix it for me.

mkozjak avatar Jan 12 '18 10:01 mkozjak

Seems to be fixed in 1.0.6

jacobbeasley avatar Jan 26 '18 15:01 jacobbeasley