I saw that discourse somehow managed to calculate the top location of the virtual keyboard on iOS.
This is important if you want to position something right on top of the virtual keyboard like this input field where I am typing in right now.
This is not an issue on android browser devices because position fixed elements are automatically pushed right up on the top of the visual keyboard when brought visible.
I’ve tested this same input field on a device with iOS 12.1 and apparently discourse managed to replicate the desired behavior even on unsupported iOS Safari versions.
Could somebody point me in the right direction in order to achieve the same result? Would highly appreciate it
I can imagine it is a mountain of hacks. I am breaking my head on this one for days already so I am ready and willing to climb that mountain with pleasure …
I already had to put a filthy hack into place in order to prevent mobile safari from lifting up the top fixed bar when focusing on an input field. Actually I think it will not be that much worse then what I had to do there to make that happen
The terrible hack was to rip stuff out of position fixed when the textarea gained focus, and hide everything on the page. Then bring it back when the textarea lost focus.
It was very quirky. So happy @pmusaraj introduced a far more robust implementation.
I took a quick look at you’re workaround , apparently you went the route of hardcoding the sizes of all possible different keyboardsizes?
When they disable auto suggestion though the keyboard changes size, how does it cope with that?
Didn’t know the crowd using iOS 12 was that low ? Are you sure about only 5% remaining with iOS 12 and lower? In that case it might be a waste of time to focus on that particular issue.
The workaround works perfectly when autosuggest is enabled … when autosuggest disables we remain with a gap … but as you already stated the amount of users still stuck on iOS 12 is so low… Even much lower for users stuck on iOS 12 in combination with auto suggest disabled.
So you’re fix is the best I can imagine. Thx for sharing !