| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
The reset branch of the cascade called the setter factory `setFunc` instead of a setter, so it built a new function and never wrote to the child. Descendants that had inherited the old value kept it after the source was reset to its default.
|
View your CI Pipeline Execution ↗ for commit d5edbb4
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at 2026-09-03 19:18:22 UTC |
Sorry, something went wrong.
npm i https://pkg.pr.new/@nativescript/core@11413 npm i https://pkg.pr.new/@nativescript/vite@11413 npm i https://pkg.pr.new/@nativescript/webpack@11413 commit: d5edbb4 |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
PR Checklist
What is the current behavior?
When an InheritedProperty (in core: bindingContext, iosOverflowSafeAreaEnabled, iosIgnoreSafeArea) is reset to its default on a node (unsetValue or 'initial'), descendants that had inherited the old value keep it. The cascade's reset branch in ui/core/properties/index.ts calls setFunc.call(child, unsetValue), but setFunc is the setter factory (valueSource) => function(value), so the call only builds and discards a setter and never writes to the child.
In practice this is reached through clearInheritedProperties() when a subtree is detached (ViewBase._parentChanged) and through Binding.updateTarget when a bindingContext binding resolves to null/undefined. InheritedCssProperty has the correct pattern (setDefaultFunc.call(childStyle, unsetValue)).
What is the new behavior?
The reset branch calls the concrete inherited setter (setInheritedValue.call(child, unsetValue)). Because the child's parent has just become ValueSource.Default, the child resolves to defaultValue with ValueSource.Default, fires its <name>Change event, and cascades to its own children. Children holding a local value are untouched, as before.
Side effect worth noting for reviewers: detaching a subtree now clears inherited view properties on all descendants (not just the removed root) and emits bindingContextChange on them during teardown. This matches what inherited CSS properties have always done; re-attaching re-propagates via propagateInheritableProperties. ListView item views receive bindingContext as a local value and are not affected.
Tests: ui/core/properties/inherited-property.spec.ts (6 cases: propagation, unsetValue reset, 'initial' reset, local descendant untouched, re-propagation after reset, end-to-end bindingContext reset on StackLayout/Label). Three of them fail without the fix.
Found while working on the property-change origin change (#11412).