TelegramMessenger / Telegram-iOS

Telegram-iOS
5.51k stars 1.49k forks source link

[Mini Apps] The window.Telegram.WebApp.expand() Method Fails to Expand App to Full Height. #1302

Open nikitabelotelov-ciliz opened 6 months ago

nikitabelotelov-ciliz commented 6 months ago

Issue in Telegram-Mini-Apps repo

Checklist

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

  1. Open @nb_bottle_bot from an iOS device.
  2. Click the menu button to open the mini-app.
  3. Click on the input to open the On-Screen Keyboard (OSK).
  4. Close the mini-app.
  5. Reopen the mini-app.
  6. Observe that the app is not fully expanded – there's a visible gap, and the tab can be dragged upwards.

Screenshots and Videos

  1. Open mini-app from @nb_bottle_bot
  2. It expands, but not on full height
  3. I drag it to the top
  4. 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

aabbdev commented 3 months ago

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

2024-03-15 18 55 54

nikitabelotelov-ciliz commented 3 months ago

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

aabbdev commented 3 months ago

Personally I can reproduce the bug on my app and all the apps I have on my Telegram

vanthao03596 commented 2 weeks ago

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 ?

sbeben commented 5 days ago

crazy any workarounds?