Telegram-Mini-Apps / issues

Centralised storage of platform issues and enhancement proposals.
11 stars 1 forks source link

`main_button_pressed` event is still being received when button is not active #2

Open heyqbnk opened 2 years ago

heyqbnk commented 2 years ago

Describe the bug In case, main button was set inactive via web_app_setup_main_button method, event main_button_pressed is still being sent. It is worth mentioning, that visually, button becomes inactive, but its functional part works incorrectly.

To Reproduce Steps to reproduce the behavior:

  1. Open Web Apps polygon bot (source code)
  2. Open developers tools (F12)
  3. Call Web Apps method:
    bridge.postEvent('web_app_setup_main_button', {
    is_visible: true,
    is_active: false,
    is_progress_visible: false,
    text: 'TEXT',
    color: '#ff0000',
    text_color: '#00ff00',
    });
  4. Tap appeared main button
  5. See console message in format [...] [Bridge] [processEvent] main_button_pressed undefined. It means, application received main_button_pressed event.

Expected behavior Event main_button_pressed is not being sent in case, button is inactive.

heyqbnk commented 1 year ago

Reported this issue in https://t.me/BugReports as long as could not find any other compatible source.