TimeView .rdtBtn fired twice on mobile devices
I'm Submitting a ...
[x] Bug report
[ ] Feature request
[ ] Support request
Steps to Reproduce
Run the TimeView component on a mobile device Hit any of the arrows buttons in order to change hours or minutes
Expected Results
Values should be increased/decreased only once at a time
Actual Results
Values are increased/decreased twice at a time
Other Information (e.g. stacktraces, related issues, suggestions how to fix)
I suppose the issue comes from this portion of code, where onTouchStart and onMouseDown might both fired on mobile devices
onTouchStart: this.onStartClicking('increase', type), onMouseDown: this.onStartClicking( 'increase', type )
Experiencing this issue too when trying to integrate time picker into a form
Any solution for that?
Which mobile device?
All iOS devices I suppose. I tested on iPhone SE & iPad
From: Rikki Tooley [email protected] Sent: Friday, March 2, 2018 11:57:22 AM To: YouCanBookMe/react-datetime Cc: Nicolas Sandron; Author Subject: Re: [YouCanBookMe/react-datetime] TimeView .rdtBtn fired twice on mobile devices (#525)
Which mobile device?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/YouCanBookMe/react-datetime/issues/525#issuecomment-369890784, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ACqGLGtiZJUR3goG48YeJuYZYL3DaLGBks5taSWSgaJpZM4SP_D-.
My issue is also coming out of IOS devices. Tested on Iphone 6 plus and 2017 ipad
Same to me! It seems to fire "onmousedown" and "onmouseup" events separately instead of a single "onclick" on all iOS touch devices. (tested on iPhone 5/6/8 and iPad).
This is happening in all the touch devices because of the duplicate event listeners (onTouchStart & onMouseDown). I think caused by this PR - https://github.com/YouCanBookMe/react-datetime/pull/506. onTouchStart event listener should be removed from the code as the touch devices support onMouseDown event.
Hey, any update on this issue?
I am experiencing same issue too.. Any quick fix for this?
while we are waiting for PR request, did anyone find a workaround?
Increment a var by 1 at each click but only update your date on even (or odd) values. It was blinking a little so I reverted but maybe it works for you.
I'm working on a react project so I just added a boolean 'incremented' to state and toggle it on/off on every change. It runs smoothly, but now it only works on mobile. This is for Cordova so I can live with it. but would be awesome if someone could approve the pr to fix this.
I'm experiencing the same issue
There is a pull request for this since March. How hard is it to accept it?
Any Update on this PR?
I just performed the fix mentioned at the top - go into timeView.js and remove all onTouchStart events. works on both browser and touch devices.
We have released a new version with the changes in it. I hope it fixes the issue! Thanks everybody for you work!