yagop / node-telegram-bot-api

Telegram Bot API for NodeJS
MIT License
8.13k stars 1.49k forks source link

Phone keyboard when open web app #1097

Closed smisyuk4 closed 11 months ago

smisyuk4 commented 1 year ago

Hi to all. I have a problem with the phone keyboard in the Telegram web app.

if the page that opens contains a form or fields where you can enter text from the keyboard, then scrolling the open window does not scroll the content

the operating system of the phone is ios and android - the result is the same. the phone keyboard closes the content of the web app

if I remove focus from the input, the keyboard hides and I can choose another input field, but this is a bug and not convenient. Not all users will try to do this, so they will simply close the window and leave the bot.

Example

await bot.sendMessage(chatId, 'Відправити оголошення', {
  reply_markup: {
    inline_keyboard: [
      [{ text: 'Заповнити форму', web_app: { url: urlReact } }],
    ],
  },
});

Question

how can I wrap my page or what should I write in the methods so that the content of the web app is fully accessible when the theophone keyboard is open?

vkruglikov commented 11 months ago

This is the usual behavior in WebApp apps. When you focus on input, mobile keyboard always will open

___UPDATE My answer has been incorrect

smisyuk4 commented 11 months ago

thanks for the answer

pavelivanov commented 10 months ago

I faced the same problem, @vkruglikov the question was how to solve the problem that the content of webpage not scrolling when an input focused (and a keyboard is opened)..

With MainButton visible there is no such problem.

FedorSherbakov commented 10 months ago

I think the question is to telegram developers, not to the author of this library

smisyuk4 commented 10 months ago

I made a crutch - increased the distance from the last button on the page to the bottom of the page. this is how a void appeared, which has no useful content and is not overlapped by the keyboard. By the way, nothing interfered with Android.

EdVollmond commented 9 months ago

I made a crutch - increased the distance from the last button on the page to the bottom of the page. this is how a void appeared, which has no useful content and is not overlapped by the keyboard. By the way, nothing interfered with Android.

Дякую, гарний костиль!