Telegram-iOS
Telegram-iOS copied to clipboard
[Mini Apps] The window.Telegram.WebApp.expand() Method Fails to Expand App to Full Height.
Issue in Telegram-Mini-Apps repo
Checklist
- [x] I am reporting an issue in existing functionality that does not work as intended
- [x] I've searched for existing GitHub issues
Description
When using the window.Telegram.WebApp.expand() method in the Telegram iOS app, the app does not expand to its full height. There remains a gap between the tab header and the upper border of the screen, and it is still possible to drag the tab upwards, indicating incomplete expansion.
Expected Behavior
The window.Telegram.WebApp.expand() method should expand the mini-app to the full available height, filling the screen without leaving any gaps or allowing further upward dragging of the tab.
Actual Behavior
After invoking the window.Telegram.WebApp.expand() method, the app does not fully expand. A gap is visible between the tab header and the top of the screen, and the tab can still be dragged upwards, which shouldn't be possible.
Steps to Reproduce
- Open @nb_bottle_bot from an iOS device.
- Click the menu button to open the mini-app.
- Click on the input to open the On-Screen Keyboard (OSK).
- Close the mini-app.
- Reopen the mini-app.
- Observe that the app is not fully expanded – there's a visible gap, and the tab can be dragged upwards.
Screenshots and Videos
- Open mini-app from @nb_bottle_bot
- It expands, but not on full height
- I drag it to the top
- It expands to full height
https://github.com/TelegramMessenger/Telegram-iOS/assets/149486224/cbf42e7b-8123-455d-9327-b620faa80391
Environment
Device: iPhone SE(3rd), iPhone 14
iOS version: 17.1.2
App version: 10.3.1
I confirm I have same problem on all apps, it's really annoying when you use flexbox because the layout isn't calculated correctly the first time
https://github.com/TelegramMessenger/Telegram-iOS/assets/30107107/11e79de2-c4c3-4fb4-b3cc-d7be10cf12b4
I still can reproduce the bug in demo from the description, but for some reason it doesn't appear anymore in our app @spinthe_bot. The code is simple:
window.Telegram.WebApp.ready(); window.Telegram.WebApp.expand();
and it runs in body onload event
Personally I can reproduce the bug on my app and all the apps I have on my Telegram
I still can reproduce the bug in demo from the description, but for some reason it doesn't appear anymore in our app @spinthe_bot. The code is simple:
window.Telegram.WebApp.ready(); window.Telegram.WebApp.expand();
and it runs in body onload event did you find any solution ?
crazy any workarounds?
I still can reproduce the bug in demo from the description, but for some reason it doesn't appear anymore in our app @spinthe_bot. The code is simple:
window.Telegram.WebApp.ready(); window.Telegram.WebApp.expand();
and it runs in body onload event
This is the solution
@ovicko It's not the solution, that's the problem. The rendering is interrupted prematurely and ends when a small movement is made to unlock the animation.