Telegram-iOS icon indicating copy to clipboard operation
Telegram-iOS copied to clipboard

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

Open nikitabelotelov-ciliz opened this issue 6 months ago • 3 comments

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

  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

nikitabelotelov-ciliz avatar Dec 11 '23 11:12 nikitabelotelov-ciliz

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

aabbdev avatar Mar 15 '24 17:03 aabbdev

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

nikitabelotelov-ciliz avatar Mar 15 '24 18:03 nikitabelotelov-ciliz

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

aabbdev avatar Mar 15 '24 19:03 aabbdev