GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(windows): let a parent resolve its children's percentage sizes by triniwiz · Pull Request #11468 · NativeScript/NativeScript

Conversation

@triniwiz

@triniwiz triniwiz commented Sep 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

PR Checklist

  • The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#commit-messages.
  • There is an issue for the bug/feature this PR is for. To avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it.
  • You have signed the CLA.
  • All existing tests are passing: https://github.com/NativeScript/NativeScript/blob/master/tools/notes/DevelopmentWorkflow.md#running-unit-tests-application.
  • Tests for the changes are included - https://github.com/NativeScript/NativeScript/blob/master/tools/notes/WritingUnitTests.md.

What is the current behavior?

On Windows, a percentage width/height is resolved by the view itself:

  • Below 100%: after each SizeChanged, a deferred pass sets Width = parent.ActualWidth * pct.
  • 100%: becomes Stretch alignment.

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 Stretch can't express 100% of a row item or a percentage height. The explicit XAML Width also overrides whatever size the parent's layout gives the child.

What is the new behavior?

The Windows View gains _setChildPercentSize(child, horizontal, fraction): boolean, which returns false by default. It's declared, Windows-only, in index.d.ts. A view with a percentage width or height hands it to its parent's _setChildPercentSize. When that returns true:

  • XAML size: Width/Height stay unset.
  • Core's own sizing: skipped (no size watch, no Stretch, no flex-basis percent).

Setting a length later calls it again with null to 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, and 75% of a grid cell. All resolve against the containing block. tsc -p packages/core/tsconfig.lib.json reports no errors. There are no specs for the Windows view.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@triniwiz triniwiz mentioned this pull request Sep 28, 2026
fix(windows): measure core views in Mason layouts, with percentage sizes triniwiz/nativescript-mason#67
Merged
@nx-cloud

nx-cloud Bot commented Sep 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

View your CI Pipeline Execution ↗ for commit 3b9f61a

Command Status Duration Result
nx test apps-automated -c=android ✅ Succeeded 3m 12s View ↗
nx run-many --target=test --configuration=ci --... ✅ Succeeded <1s View ↗

💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗


☁️ Nx Cloud last updated this comment at 2026-10-19 13:21:43 UTC

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@pkg-pr-new

pkg-pr-new Bot commented Sep 28, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@nativescript/core@11468
npm i https://pkg.pr.new/@nativescript/vite@11468
npm i https://pkg.pr.new/@nativescript/webpack@11468

commit: bec24b5

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@triniwiz
feat(windows): let a parent resolve its children's percentage sizes
7d0adce
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
triniwiz force-pushed the fix/windows-parent-percent-sizing branch from e1bd329 to 7d0adce Compare September 28, 2026 13:15
This was referenced Sep 28, 2026
fix(canvas): hand a % size to a parent that lays out its children itself NativeScript/canvas#162
Merged
fix(windows): lay out scroll elements nested in Mason layouts triniwiz/nativescript-mason#68
Merged
triniwiz added 2 commits September 30, 2026 03:20
@triniwiz
Merge branch 'feat/windows' into fix/windows-parent-percent-sizing
68ab1fa
@triniwiz
Merge branch 'feat/windows' into fix/windows-parent-percent-sizing
6b21744
@triniwiz triniwiz mentioned this pull request Oct 9, 2026
feat(windows): view location in window, on screen and relative to a view #11515
Merged
1 of 5 tasks
triniwiz added 7 commits October 9, 2026 13:38
@triniwiz
Merge branch 'feat/windows' into fix/windows-parent-percent-sizing
d5068bb
@triniwiz
Merge branch 'feat/windows' into fix/windows-parent-percent-sizing
ce204ca
@triniwiz
Merge branch 'feat/windows' into fix/windows-parent-percent-sizing
79d03e6
@triniwiz
Merge branch 'feat/windows' into fix/windows-parent-percent-sizing
6766b3d
@triniwiz
Merge branch 'feat/windows' into fix/windows-parent-percent-sizing
3b9f61a
@triniwiz
Merge branch 'feat/windows' into fix/windows-parent-percent-sizing
bec24b5
@triniwiz
feat(windows): view location in window, on screen and relative to a v…
3917e9f
…iew (#11515)

getLocationInWindow and getLocationRelativeTo transform the element's origin
through XAML; getLocationOnScreen adds the window's client origin, read off its
AppWindow (cached per XamlRoot) by a window-helper util.
@triniwiz
triniwiz merged commit f301728 into feat/windows Oct 23, 2026
5 of 6 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@triniwiz
triniwiz deleted the fix/windows-parent-percent-sizing branch October 23, 2026 03:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@triniwiz
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.