You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If using an iOS device (tested on safari iOS 13 on iPhone and iPad) a simple tap to choose an hour will also select the minute with the closest placement.
This behavior is not so bad if the picker does not close itself, but I built one with the option closeOnMinuteSelect enabled and what happens is that with one tap both get selected and the picker closes. Thus the only choosable times are 12:00, 1:05, 6:30, etc...
This does not happen if instead of tapping the finger is held, dragged around and released.
I inspected the events firing in mobile safari and it seems like there are both touch and click events going on. My guess is that there is a preventdefault call missing in the touchstart or touchdown events, that would tell iOS not to generate a click one as well, but I'm not sure. I haven't tested it deeply.
Here is a screencast showing the problem. I'm only clicking on the hours and you can see the seconds immediately change (then I click on the hour number at the top to try again).
The text was updated successfully, but these errors were encountered:
Today I forked the project and added some logs to try to understand the issue with the touch and click events. This is the "typical" flow of events on desktop (true in 'send change' corresponds to canAutoChangeUnit in calculatePoint):
And this the one on my iPhone:
Which suggest something needs to be done in the touch handlers to let safari know that it should not trigger the click ones as well. But I wonder, doesn't this happen on android browsers too? Or do they determine whether a website has properly reacted to a touch event (to maybe send a click one) in a different way?
If using an iOS device (tested on safari iOS 13 on iPhone and iPad) a simple tap to choose an hour will also select the minute with the closest placement.
This behavior is not so bad if the picker does not close itself, but I built one with the option
closeOnMinuteSelect
enabled and what happens is that with one tap both get selected and the picker closes. Thus the only choosable times are 12:00, 1:05, 6:30, etc...This does not happen if instead of tapping the finger is held, dragged around and released.
I inspected the events firing in mobile safari and it seems like there are both touch and click events going on. My guess is that there is a
preventdefault
call missing in the touchstart or touchdown events, that would tell iOS not to generate a click one as well, but I'm not sure. I haven't tested it deeply.Here is a screencast showing the problem. I'm only clicking on the hours and you can see the seconds immediately change (then I click on the hour number at the top to try again).
The text was updated successfully, but these errors were encountered: