react-datetime icon indicating copy to clipboard operation
react-datetime copied to clipboard

TimeView .rdtBtn fired twice on mobile devices

Open NicoDos opened this issue 8 years ago • 17 comments

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 )

NicoDos avatar Feb 22 '18 21:02 NicoDos

Experiencing this issue too when trying to integrate time picker into a form

Drdos3s avatar Feb 25 '18 19:02 Drdos3s

Any solution for that?

nbudinov avatar Mar 02 '18 08:03 nbudinov

Which mobile device?

rikkit avatar Mar 02 '18 10:03 rikkit

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-.

NicoDos avatar Mar 02 '18 14:03 NicoDos

My issue is also coming out of IOS devices. Tested on Iphone 6 plus and 2017 ipad

Drdos3s avatar Mar 02 '18 15:03 Drdos3s

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).

redbaron76 avatar Mar 13 '18 10:03 redbaron76

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.

wasif-danesh avatar Mar 15 '18 23:03 wasif-danesh

Hey, any update on this issue?

experionarjun avatar Mar 23 '18 04:03 experionarjun

I am experiencing same issue too.. Any quick fix for this?

Suresh-R-S avatar Mar 23 '18 04:03 Suresh-R-S

while we are waiting for PR request, did anyone find a workaround?

Martsyalis avatar Apr 05 '18 01:04 Martsyalis

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.

NicoDos avatar Apr 05 '18 06:04 NicoDos

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.

Martsyalis avatar Apr 05 '18 23:04 Martsyalis

I'm experiencing the same issue

fbedussi avatar May 01 '18 22:05 fbedussi

There is a pull request for this since March. How hard is it to accept it?

THETCR avatar May 15 '18 14:05 THETCR

Any Update on this PR?

shobanabalasingacube avatar Jun 28 '18 05:06 shobanabalasingacube

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.

fonty422 avatar Jul 03 '18 13:07 fonty422

We have released a new version with the changes in it. I hope it fixes the issue! Thanks everybody for you work!

arqex avatar Jul 24 '18 13:07 arqex