telegram-mini-apps / issues Goto Github PK
View Code? Open in Web Editor NEWCentralised storage of platform issues and enhancement proposals.
Centralised storage of platform issues and enhancement proposals.
Describe the bug
It seems like web_app_set_background_color
works incorrectly on Android. In case, you call this method, visually, nothing happens. But if you close this Web App and open again, you will see set color unless application is loaded.
Firstly, set color should probably be dropped when application was closed. Secondly, could we make WebView background transparent to make it work as expected? I mean, we would like HTML body
to be transparent to see previously specified color, is it possible?
To Reproduce
Steps to reproduce the behavior:
bridge.postEvent('web_app_set_background_color', {color: '#ffffff'});
body
has no color specifiedExpected behavior
Background color is being set with color specified in method. Specified color is dropped when application was closed.
Linux desktop / android phone
Store a json string from webapp api
Launched from bottom keyboard
That is created by arduino esp8266
To me strange that the
Web storage cloud storage max 1024 key data
Also can be changed if webapp is launched from other places
Unlike web app send data
Describe the bug
No effect when posting web_app_set_header_color
and web_app_set_background_color
events. There are no visual changes and changes in DOM.
To Reproduce
Steps to reproduce the behavior:
WebView.postEvent('web_app_set_header_color', {color_key: 'secondary_bg_color'})
or
WebView.postEvent('web_app_set_header_color', {color_key: 'bg_color'})
WebView.postEvent('web_app_set_background_color', {color: '#ffffff'})
Expected behavior
Colors change right after event posting.
Select platforms where this bug is reproducible:
window.Telegram.WebApp.expand() doesn't expand app to full height. After calling .expand() method, there is a gap between tab header and upper border of the screen. Additionally, it's still possible to drag the tab upwards to increase its height, which indicates that the expansion is not complete.
Steps to reproduce the behavior:
The window.Telegram.WebApp.expand() method is expected to fully expand the mini-app to the maximum available height.
What happens on the video:
Linux mint x86 64 desktop
Input type time
no timepicker on linux dektop
ok on android phone
https://t.me/LuberthDijkmanbot/schedule
Video
https://t.me/Luberth_Dijkman/86
No timepicker on input type time in telegram miniapp webapp
Ok in chromium website
Routing of new documentation throws a 404 error when reloading the page
Select platforms where this bug is reproducible:
I am developing Telegram Mini app using Next.JS framework with App router. I am using @tma.js/sdk-react package. And there is an issue on every Android device. When you open mini app via Menu button, bottom part of it is hidden under user message input. Like on the image, on the left side.
Steps to reproduce the behavior:
I want the mini app to open with correct viewport height.
May be I am doing something wrong?
Describe the bug
Events web_app_request_theme
and web_app_request_viewport
do not return information about current theme and viewport. Unlike iOS and Android, desktop and web versions of Telegram do not emit such events as theme_changed
and viewport_changed
. There is just no reaction on these events.
To Reproduce
Steps to reproduce the behavior:
bridge.postEvent('web_app_request_theme');
bridge.postEvent('web_app_request_viewport');
Expected behavior
The same behavior on all platforms - emit of events theme_changed
and viewport_changed
with correct parameters.
Is your feature request related to a problem? Please describe.
According to official documentation (method ready()
), we should call function ready()
in case, when application is ready to be shown. Additionally, description of method says:
It is recommended to call this method as early as possible, as soon as all essential interface elements are loaded. Once this method is called, the loading placeholder is hidden and the Web App is shown.
If the method is not called, the placeholder will be hidden only when the page is fully loaded.
The problem is application will be displayed even in case, when it did not notify native app about it is ready to be displayed. In other words, when all static files of application are loaded, it will be shown automatically, but at this time, there could be some async operations which were trying to receive required theme parameters of application. As a result, this will lead to application "flashes" as long as theme params could change on-flight.
Describe the solution you'd like
Do not display application automatically. Make ready()
function the only one explicit way of hiding application placeholder, because it leads to not resolvable problems.
Describe alternatives you've considered
-
Additional context
-
Select platforms where this bug is reproducible:
Why does the old miniapp's input box fail to pop up the soft keyboard after closing another miniapp
Steps to reproduce the behavior:
Pop up soft keyboard!
There is an unexpected gap between the on-screen keyboard and the input field within a Telegram Mini App when the keyboard is active. The input field is intended to be positioned at the bottom of the screen, but upon activating the OSK, there is a visible space separating the two, which is not consistent with the expected UI layout.
Steps to reproduce the behavior:
The expected behavior is that when the on-screen keyboard is activated, the input field should align directly above the keyboard without any noticeable gaps.
Is your feature request related to a problem? Please describe.
Currently, when Web App is loading, Telegram application does not display any loader. The only one thing user sees is a WebView with white background and missing content . To let user know that application is loading, Telegram application should display loader instead of white WebView. I saw loader in bottom right of shown popup, but white WebView breaks any sense of native application which Web App should look like.
Describe the solution you'd like
To make it look the same on all platforms, you could see how it works in macOS version of Telegram:
I also provide some tip from official Telegram documentation about how loader hiding should work. Taken from description of web_app_ready
method logic.
A method that informs the Telegram app that the Web App is ready to be displayed. It is recommended to call this method as early as possible, as soon as all essential interface elements are loaded. Once this method is called, the loading placeholder is hidden and the Web App is shown.
Describe alternatives you've considered
You can find good solution made by Telegram macOS developers.
Additional context
-
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:
bridge.postEvent('web_app_setup_main_button', {
is_visible: true,
is_active: false,
is_progress_visible: false,
text: 'TEXT',
color: '#ff0000',
text_color: '#00ff00',
});
[...] [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.
Describe the bug
Every time, we switch night mode, native app automatically appends its own style tag:
To Reproduce
Steps to reproduce the behavior:
head
tag changeshead
tag contains a lot of almost the same style
tagsExpected behavior
It seems that native app appends style tag with styles according to current theme, but it looks like the correct way is not to always append new style tag, but replace last one added. Otherwise, elements become flooded with same CSS rules.
Describe the bug
Each platform sends different values in popup_closed
event payload.
Android: {}
Desktop: undefined
iOS: null
Web: { button_id: { isTrusted: true } }
To Reproduce
Steps to reproduce the behavior:
bridge.postEvent('web_app_open_popup', {
title: 'Title',
message: 'Message',
buttons: [{type: 'ok', id: 'ok'}]
})
Expected behavior
Event payload is the same on all platforms.
Select one of the following:
Web version of Telegram does not really reloads Mini App iframe, but instead, it re-inserts it. The reason is Telegram Web has no access to iframe location and is not able to reload it.
The second problem here is Telegram Web is also unable to reload it saving current application location. So it just drops window.location to the initial one, which leads to loss of application routing state.
Here is the original issue: Ajaxy/telegram-tt#282
Describe the bug
According to official documentation of viewport_changed
event, it should send actual height of visible area of Web App. Currently, we get it with 1 exclusion - in case, when this height is less than some minimal value (for me it was 481px), native device sends it instead of visible area height.
To Reproduce
Steps to reproduce the behavior:
eruda
console (bottom right cog in application interface)viewport_changed
events where height is not less than some fixed value, but should be close to 0.Expected behavior
Strongly following documentation, event should contain height of visible area.
Select platforms where this bug is reproducible:
While developing TMA with payment integration (in fiat) - faced next issue. All payments (test & live) just hangs and then throw error.
Both methods createInvoiceLink() and sendInvoice() correctly generate invoice link/ invoice. The problem is when in Invoice element button "pay" clicked.
I'm located in Minsk, Belarus. Tried different VPN and payment providers.
Steps to reproduce the behavior:
Test payments should passed successfully
A clear and concise description of what you expected to happen.
Describe the bug
According to web_app_setup_closing_behavior
method documentation, it should prevent user from losing important information in case, Web App is going to close.
Nevertheless, this method does not work correctly in iOS and Android. iOS, probably, implemented it a bit better. Application does not allow opening bot and chat information which could lead to Web App close somehow. For example, when user clicks some link in attachments or something like that. It just doesn't allow doing a lot of actions. Android works a bit different, it allows doing that which may lead to Web App close.
iOS and Android
Method does not work in case, user presses Menu Button, it just closes the Web App without showing confirmation dialog. The Web App will also be force closed in case, user pressed chat message input.
Android only
Method does not work in case, when Web App is minimized and user presses back button on the left from bot avatar. It closes Web App without confirmation dialog.
To Reproduce
Steps to reproduce the behavior:
bridge.postEvent('web_app_setup_closing_behavior', {
need_confirmation: true,
});
Expected behavior
Telegram application shows confirmation dialog in case, user or application action is going to close Web App. It probably should
also work in case, app calls web_app_open_link
and similar methods.
I personally think that telegram-mini-apps/awesome-telegram-mini-apps would be a way catchier name for the awesome list, and would like to have it under that if both sides agree on it.
Select platforms where this bug is reproducible:
<template>
<input type="file" name="files[]" accept="image/*" multiple @change="uploadFile" />
</template>
<script>
function uploadFile() {
console.log('Upload File')
}
</script>
When the HTML attributes accept and multiple are used simultaneously in Vue3 project, the change event does not fire on Android.
Steps to reproduce the behavior:
Console.log output 'Upload File' text in console.
Describe the bug
In case, main button became visible or hidden, native app does not send viewport_changed
event even in case, viewport really changed. On client side you should always track resize
event and update current viewport data which seems implicit.
To Reproduce
It will be a bit harder for me to show how to reproduce this problem as long as I can't use libraries and examples I provided before because they already close this problem locally. The only thing I could help you here with is to provide minimal code HTML example which shows the problem:
<html>
<head>
<meta charset="UTF-8">
<meta
name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"
>
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="https://cdn.jsdelivr.net/npm/@twa.js/[email protected]"></script>
</head>
<body>
<script>
const {defineEventReceiver, postEvent} = window.TwaBridge;
// Define event receiver which will allow us to handle native app events.
defineEventReceiver();
// Add message event handler to display event received from native app.
window.addEventListener('message', e => {
if ('eventType' in e.detail) {
console.log('Received event:', e.detail);
}
});
// Log app height before showing main button.
console.log(window.innerHeight);
// Show main button.
postEvent('web_app_setup_main_button', {
is_visible: true,
is_active: true,
is_progress_visible: false,
text: 'TEXT',
color: '#ff0000',
text_color: '#ffffff',
});
// After some timeout show new app height.
setTimeout(() => {
console.log(window.innerHeight);
}, 1000);
</script>
</body>
</html>
To check if external events handling works correctly, you could press main button and see log message in console.
Expected behavior
Event viewport_changed
is sent every time, its height or other parameters changed.
Select platforms where this bug is reproducible:
window.Telegram.WebApp.viewportHeight returns incorrect value when on-screen keyboard(OSK) is opened. The value doesn't change either the OSK is opened or not.
Steps to reproduce the behavior:
window.Telegram.WebApp.viewportHeight returns correct visual viewport height
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.