File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed
packages/telegram-apps-sdk/2-x/components Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,25 @@ if (bindViewportCssVars.isAvailable()) {
110110
111111:::
112112
113+ ## Visibility
114+
115+ To track if mini app is visible, use ` isVisible ` signal.
116+ Invisible means app is collapsed or in another tab.
117+
118+ ::: code-group
119+
120+ ``` ts [Variable]
121+ viewport .isVisible ();
122+ ```
123+
124+ ``` ts [Functions]
125+ import { isVisible } from ' @telegram-apps/sdk' ;
126+
127+ isVisible ()
128+ ```
129+
130+ :::
131+
113132## Expanding
114133
115134To expand the viewport, use the ` expand ` method.
Original file line number Diff line number Diff line change @@ -349,6 +349,16 @@ user started dragging the application or called the expansion method.
349349> application window. You should probably use a stable height instead of the current one, or handle
350350> this problem in another way.
351351
352+ ### ` visibility_changed `
353+
354+ Available since: ** v8.0**
355+
356+ Occurs whenever the mini app is visible or hidden (means collapsed or in another tab).
357+
358+ | Field | Type | Description |
359+ | ------------| -----------| ----------------------------------------------------|
360+ | is_visible | ` boolean ` | Indicates if the application is currently visible. |
361+
352362### ` write_access_requested `
353363
354364Available since: ** v6.9**
You can’t perform that action at this time.
0 commit comments