-
-
Notifications
You must be signed in to change notification settings - Fork 241
Description
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.