-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot get onClick event to fire on a draggable element in latest ios safari #1367
Comments
Is this an issue? |
Potentially, I'm not sure how it's intended as I didn't find a ton of documentation on using onClick with dnd on a mobile device. I moved to onTouchEnd with some prevent default logic to make it work on mobile but using onClick never seemed to work. However now I have the problem that when I scroll the screen the onTouchEnd event fires so this doesn't really work for me. I'm not so familiar with touch events so I might be missing something but my thought is if onClick worked then firing on scroll wouldn't happen. I can reopen once I get your feedback. Thank you. |
My expectation is that clicking should be unaffected by |
Ok. After more testing onClick is definitely not working on ios with all browsers, at least in my case. Seems to work fine on android. I will put together a code sample on stackblitz to reproduce shortly. Thanks. |
Thanks!
…On Thu, Jun 20, 2019 at 2:27 PM James Billings ***@***.***> wrote:
Ok. After more testing onClick is definitely not working on ios with all
browsers, at least in my case. Seems to work fine on android. I will put
together a code sample on stackblitz to reproduce shortly. Thanks.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1367?email_source=notifications&email_token=AAQU33JWJHVDYC5Z3VPJBY3P3MBMHA5CNFSM4HZF4QGKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYD7DIA#issuecomment-503837088>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAQU33P3OVJLM2E6WBBLLXDP3MBMHANCNFSM4HZF4QGA>
.
|
Ok I have a code example. I have copied the simple list example and added an onClick handle to the element inside of Draggable that creates a browser alert. Works fine in the desktop browser but not in ios. Of course you will need to look at this from an iphone/ipad to view the potential bug. App url here: https://react-ub51sd.stackblitz.io |
Before I dig into it more, can you please try using |
I gave it a go but no luck unfortunately, same deal. |
Did this only just start happening in the latest ios safari? |
(it is okay if you are not sure) |
This is happening on Chrome, Firefox & Safari on IOS. Android seems to be fine across the board. I have an iphone 7 with the latest safari, chrome & firefox and happens on all. I also have an older iPad and I'm seeing the same thing there. I have several other QA members that have experienced the same (working on Android, not working on ios) both with our production code and the simpler code example I sent you just to be sure. |
I am testing on latest safari and |
It is working fine on my iphone .. 😕 |
So just to be clear when you visit this url on your iPhone and tap on an item you get an alert? https://react-ub51sd.stackblitz.io/ If so I’m going to do more testing then with different iPhone versions because that’s definitely not what I’m seeing. |
I’m testing that url above on multiple iPhone versions and still don’t get an alert on click. I’m not really sure how to proceed here but clearly something is off. I can create a video of this just to prove it but it’s not going to help anything I imagine. Thanks! |
Maybe there is something going on with the stackblitz platform? Given that |
Our "solution" was to downgrade to 10.1.1 which is the latest version that works... All the later versions including 12 alphas are not working. All touch/click events seems to be swallowed when you touch draggable element. Even the official examples like https://react-beautiful-dnd.netlify.com/iframe.html?id=single-vertical-list--basic and https://react-beautiful-dnd.netlify.com/iframe.html?id=board--simple are not working for me. Running Safari on iOS 12.3.1 on iPhone X however we got many reports from users using different models/versions. |
Good to know @dovydaskukalis thank you. |
It is interesting that 11.x is not working too 🤔 |
That is worrying if correct |
Can you please change |
Unfortunately it didn't fix it, I tried on 11.0.4 and nothing changed, except now force touch works with it's default action of opening a preview popup. |
This aligns with the issue I have reported regarding scrolling the container of draggable items: |
I'm also experiencing #1396, hopefully the fix well get both bugs resolved then. Thanks for the input. |
I have shipped the workaround in an alpha for validation:
Please try it out and let me know how it goes |
So far this has fixed all the problems for me. The screen is now scrolling correctly on a mobile and click is working as expected. Thank you for your hard work, this is a great product! |
Expected behavior
I should be able to add an onClick handle to a draggable element and see it fire when I click on the draggable element without dragging it.
Actual behavior
Almost never fires the click event. If I keep persisting it will.
Steps to reproduce
Visit the example for a simple list on an ios device using safari - https://react-beautiful-dnd.netlify.com/iframe.html?id=single-vertical-list--basic
On a desktop if you click one of the items it will link you to another url, but on a ios mobile using safari if you touch one of the items it doesn't go anywhere. I haven't confirmed this is only with IOS and safari and not all mobile. I'm also wondering if there is any correlation with this and the following issue which I'm also experiencing: #1314
The text was updated successfully, but these errors were encountered: