Telegram-Mini-Apps / telegram-apps

Made from scratch TypeScript packages, examples and documentation you will surely need to start developing on Telegram Mini Apps.
https://docs.telegram-mini-apps.com/
MIT License
617 stars 163 forks source link

[Bug]: swipeBehaviour.disableVertical() doesn't work #490

Closed daniilkananenka closed 1 week ago

daniilkananenka commented 1 week ago

Telegram Application

Telegram for Android, Telegram for iOS

Describe the Bug

In new major version of @telegram-apps/sdk-react swipeBehavior.disableVertical() doesn't work as expected - it doesn't disable vertical swipes at all.

To Reproduce

Steps to reproduce the behavior:

  1. Install new major version of @telegram-apps/sdk-react
  2. In your init.ts file add import {swipeBehavior} from '@telegram-apps/sdk-react
  3. In your init function add
    swipeBehavior.mount();
    swipeBehavior.disableVertical();
  4. Run your mini app on mobile with Telegram App, that supports vertical behavior
  5. Try to close mini app using swipe and see error

Expected Behavior

swipeBehavior.disableVertical() should disable vertical swipes

daniilkananenka commented 1 week ago

Temporarily fix from @heyqbnk :

postEvent('web_app_setup_swipe_behavior', { allow_vertical_swipe: false });
heyqbnk commented 1 week ago

Fixed in @telegram-apps/sdk@2.4.0. Thank you for report!

PR: https://github.com/Telegram-Mini-Apps/telegram-apps/pull/491