Skip to content
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

iOS requires two clicks to show keyboard with dgrid editor and custom widget #1345

Open
adamdport opened this issue Jan 19, 2017 · 6 comments

Comments

@adamdport
Copy link

In my implementation, my cells require two clicks to show the keyboard on iOS. The first click creates the input, but a second click is required to focus the input.

After investigating, the issue is in this setTimeout method. iOS will only show the keyboard if the focus is executed via something that was initiated via a user action. I've verified that removing the setTimeout from dgrid resolves my issue.

The comments surrounding the setTimeout imply that it's necessary for dgrid-cellfocusin. I'm using editon: 'click'. I'd be happy to try to recreate it in a jsfiddle if you can provide a starting point (basic grid with a custom widget). Thanks!

@dylans
Copy link
Member

dylans commented Jan 19, 2017

@adamdport here's a relatively recent jsfiddle you can clone, https://jsfiddle.net/dylan/9rgodm0e/3/ . It doesn't have a custom widget, but feel free to ask if you get stuck.

@adamdport
Copy link
Author

Turns out it's not related to our custom widget. Nothing in this fiddle launches the keyboard on first click in iOS: https://jsfiddle.net/55g58b4L/6/

Let me know if I'm doing something wrong. Thanks.

@adamdport
Copy link
Author

Any updates on this? Could you at least confirm it's a dgrid issue and not just something I'm doing wrong?

@dylans
Copy link
Member

dylans commented Jan 31, 2017

I started looking at it a few days ago, and I get very intermittent results... sometimes a first tap works, sometimes it takes several taps to get anything to respond. However, when I try out our tests such as http://dgrid.io/js/dgrid/test/Editor.html I don't see a similar issue, so then I started wondering if it was either something odd with JSFiddle, or something on iOS with a combination of the Keyboard and Editor mixins. My guess is that something has changed in a subtle way with iOS 10, focus events, and pointer event handling, but that's as far as I've gotten thus far.

@adamdport
Copy link
Author

I'm going to test it again tomorrow, but I believe removing the timeout I linked to resolved my issues, and the comment above it suggested it was only to resolve some dgrid-cellfocusin issue:

// focus / blur-handler-resume logic is surrounded in a setTimeout
// to play nice with Keyboard's dgrid-cellfocusin as an editOn event

I don't know what that original issue was, but perhaps there's a way to resolve it without this timeout.

@adamdport
Copy link
Author

I've tested again, and confirm that commenting out the timeout (so that the focus() commands happen immediately) resolves the issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants