This is by design, there is no way in JavaScript to detect if a hardware keyboard is connected or if a software keyboard is visible… because … Apple and Google don’t seem to think this is a problem that needs solving.
At least Google change the viewport size, Apple don’t even do that.
I don’t recall where it was implemented, but this post on SE has the gist of it.
If there’s really no workaround does that mean a new approach to composer for mobile? Something in-line? Even a toggle to anchor the UI would be better than the current arrangement, I have to split-screen two different browsers to see the post I was originally responding to, and if I’m signed into Discourse from both then I can see my draft in both sessions!
We already have hack mountain including a bunch of stuff that is not even documented on SE. The trouble with answers there is they are hacky and often break between iOS releases.
It is possible more hacks can get this to magically detect this, I am not sure. But we can not afford to compromise standard software keyboard behavior by issuing random scroll events to fish for this.
Get that this is frustrating, but Apple ought to give us a correct viewport height somehow. Recommend you raise that with apple, I already did, got no answer.
This seems like a pretty big one, over the weekend a CxO reverted to using email when they realised they couldn’t see the message they were responding too. A pretty sizeable blow to the success of that particular project.
I get that, but I’m pretty sure a while back it didn’t hijack the whole display.
I understand why it’s there when the on-screen keyboard is used. That said, with the on-screen keyboard not being able to see the post severely hampers the ability to compose a response.
Given the limited screen real-estate that exists on the iPad in the first place, you could consider another approach here entirely. Since waiting 8+ years (since 2011) for Apple doesn’t sound like we’re onto much momentum, right?
How about:
A dedicated “new post” page that doesn’t overlay anything, it just gives you a large textarea to post in.
This page could have a separate preview mode (as a button or so) to give more screen real-estate to writing and editing
Larger font-size
I’ve given up my computer and exclusive use iPad Pro. A big reason I do it is to focus on writing. This works superbly with something like iA Writer, but it’s harder with Discourse due to this bug, and that the font is pretty small etc.
Will also report another bug about smooth scrolling.
I am not sure this is the case. Apps can definitely work around all these limitations, but the web is unaware of the fact a keyboard is connected or not.
A theme component can be built that would allow you to “trigger” a mode where we just assume a keyboard is connected and then don’t implement all our virtual keyboard hacks. I think this is the only real workaround I can think of. It would require you though to tick a box in your user profile for:
[ ] I am using an iPad with a real hardware keyboard
That is of course an approach. And I respect your decision, as a company, to support whichever devices you wish.
That being said, as a user, and as your faithful customer, my expectations are that your modern forum software supports reading and writing superbly on both desktop as well as on mobile devices. Hence my request. My context is that I’m using iPad exclusively.
It seems you are right. However, their solution is a layout where it doesn’t matter, such as the one I proposed.
In other words, it’s another approach than relying on Apple fixing keyboard detection bugs. It’s a layout solution, like the one I proposed above.
Thanks for listening and responding back so quickly.
You’re using it in a very unusual way though, with an external keyboard. This is rare.
I’d love to support it, but we need the browser to be aware of keyboard state for that to work properly. That is the critical part that needs to be followed up on, and unfortunately I do not control the Mobile Safari binary. Only Apple does.
My mention of iA Writer was as an example of the full-size, distraction-free writing environment I’m craving in general.
The “layout solution” I’m talking about specifically here is Gmail’s mobile site. Their composer is not perfect but it doesn’t jump around the same way Discourse’s editor does currently.
An even better example might be Medium’s editor. With external keyboard:
Another thing Medium’s editor does well is to support image insertion from the clipboard on iOS (via CMD+V). Discourse’s editor does not respond to that command when I have an image in the clipboard. But perhaps I should request that separately.