Conversation
|
View your CI Pipeline Execution ↗ for commit 7d0adce
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
commit: |
View gains _setChildPercentSize(child, horizontal, fraction), which returns false. A percentage width or height is handed to the parent's; when it returns true, core leaves the XAML Width/Height unset and skips its own percent sizing. Setting a length clears it (fraction null).
triniwiz
force-pushed
the
fix/windows-parent-percent-sizing
branch
from
September 28, 2026 13:15
e1bd329 to
7d0adce
Compare
This was referenced Sep 28, 2026
Merged
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Checklist
What is the current behavior?
On Windows, a percentage
width/heightis resolved by the view itself:SizeChanged, a deferred pass setsWidth = parent.ActualWidth * pct.100%: becomesStretchalignment.A parent that lays out its children with its own engine can't use that. The value ignores the parent's padding and the child's position in a row, and
Stretchcan't express100%of a row item or a percentage height. The explicit XAMLWidthalso overrides whatever size the parent's layout gives the child.What is the new behavior?
The Windows
Viewgains_setChildPercentSize(child, horizontal, fraction): boolean, which returnsfalseby default. It's declared, Windows-only, inindex.d.ts. A view with a percentage width or height hands it to its parent's_setChildPercentSize. When that returnstrue:Width/Heightstay unset.Stretch, no flex-basis percent).Setting a length later calls it again with
nullto clear it. Every existing parent uses the default, so their behavior doesn't change.Related: triniwiz/nativescript-mason#67 overrides it for its layouts.
Testing: tested on Windows x64 with that branch, covering
50%in a row,100%×100%in a row,50%height with margins in a fixed-height column, and75%of a grid cell. All resolve against the containing block.tsc -p packages/core/tsconfig.lib.jsonreports no errors. There are no specs for the Windows view.