Skip to content

On Android signals are not delivered for pages still residing on the page stack but being covered by another page #2386

@cjohn001

Description

@cjohn001

Environment

✔ Getting NativeScript components versions information...
✔ Component nativescript has 8.9.3 version and is up to date.
✔ Component @nativescript/core has 8.9.7 version and is up to date.
✔ Component @nativescript/ios has 8.9.2 version and is up to date.
✔ Component @nativescript/android has 8.9.1 version and is up to date.
"apollo-angular": "11.0.0",
"@angular/animations": "20.1.4",
"@angular/common": "20.1.4",
"@angular/compiler": "20.1.4",
"@angular/core": "20.1.4",
"@angular/forms": "20.1.4",
"@angular/platform-browser": "20.1.4",
"@angular/platform-browser-dynamic": "20.1.4",

Describe the bug
I am observing a problematic behavior on android. When changing a signal value the signal seems to be not evaluated in case a page is covered by another page. I mean, by navigating away from the page and the page is residing on the page stack, no signals seem to be delivered anymore.

What I want to achieve is to trigger a *ngIf to remove a chart on the page when the page was left (needed as redrawing on the covered page results in app crashing on onDeviceOrientationChanged). I do this by subscribing to the page Service
Example:

public _displayChart = signal<boolean>(false)
this._subscription.add(this.pageService.inPage$.subscribe(inPage => {
   this._displayChart.set(inPage);
  // this.cdr.detectChanges()
 })

Expected behavior
I think in order to adopt for the behavior on mobile, I mean pages reside on the page stack rather than being destroyed like when left in the browser, the expected behavior should be that signal changes are propagated when they appear. I also see the issue on effects not being executed when page is left.

A workaround is possible to enforce signal execution via calling change detection manually (commented line ..detectChanges). However, would be nice if not such workarounds would be required.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy