Keyboard Problems On IOS

So when I have an HTML Input element on IOS, clicking in it causes the keyboard to open, but you can’t type.

I’ve traced the code into PlayCanvas Stable and it is not calling either preventDefault or stopPropagation. Is there somewhere else this might be happening?

Does this happen when you launch from the Editor or in a published build? If it’s happening in a published build can you also check if it happens when you launch from the Editor?

It doesn’t happen on desktop - only on iOS. I’ve tried launching from my phone through the editor - but I can’t seem to tap anything so I can’t get to that screen

It’s hard to click Launch from the Editor on mobile - alternatively you could try manually entering the launch URL on your phone? I noticed when playing your game on my Mac that when I typed my username, if I typed it fast some characters were disappearing. Makes me think that maybe you’re doing something with that input?

No the game launched on the phone - but I couldn’t tap the home screen to continue.

That’s just an input wired up with AngularJS - nothing fancy.

It looks like I can’t tap anything either on my iPad - Not in the launch URL or the published app. Do you think you can fix that? I would guess it’s some touch handler that needs to be registered.

Yeah it worked until this morning - now it doesn’t work on anything… I didn’t change anything! Was it you guys?

I’ve added FastClick to try to get it to work, but no luck

I’m not sure what’s going on there, but it looks like something is swallowing touch events. Can you try adding touch events on the window or the document instead of app.touch?

LOL all my fault

I’d prevented touch trying to make the keyboard work lol.

That’s what happens when you pull an all nighter post 40

Ah OK, that explains it :smiley:

Ok so that now can be clicked LOL.

So launched from the editor still no ability to type.

I don’t think there is something we’d do that would break input fields. I made a simple example project which seems to work on my iPad: I think maybe angular or something in there makes that field work differently in your project, because it definitely does something other than the default inputs - like I said before if you type stuff fast, it seems to make characters disappear.

Yeah I’ve added a basic blank input field now - not wired to anything with a default value

That also doesn’t work :frowning:

What if you remove everything from the input field (if you haven’t already). That means ng-keypress stuff ng-change stuff, just put a completely vanilla input field. Does it still act like that?

Yes a blank one acts like that. The ng-keypress event is firing but a blank input doesn’t work - hang on I’ll add one back.

Ok there’s one in there now - weird it’s like it’s disable too - the text is light etc. But that could just be the CSS

It’s not readonly in the debugger

I do hate this crap LOL. Spend weeks writing a game and worrying about data rates, compress etc. Then I can’t get a bloody input control to work…

I’m figuring it must be something to do with the touch events, but I’ve disabled everything of mine now I think. Still a problem. I found a few things on Google that sounded similar but none of them work.

1 Like

My feeling is this is Angular doing something weird. The input fields do work on my Android phone though. Another thing I’d try just for debugging would be to add a plain input field directly on the document, so outside any angular views and see if that works.

I had this on a work project on iOS and it killed me for weeks until I found a prevent default on a touch event. But I can’t see one now.

Well always on for a hack me. I’m detecting iOS and writing my own keyboard handler LOL