Skip to content

[0.81] Port textinput fixes and outline property fix - #16387

Merged
Vladimir Morozov (vmoroz) merged 7 commits into
microsoft:0.81-stablefrom
acoates-ms:port81
Aug 21, 2026
Merged

[0.81] Port textinput fixes and outline property fix#16387
Vladimir Morozov (vmoroz) merged 7 commits into
microsoft:0.81-stablefrom
acoates-ms:port81

Conversation

@acoates-ms

@acoates-ms Andrew Coates (acoates-ms) commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Port #16336, #16317, #16338, #16337, and #16386 to 0.81

Microsoft Reviewers: Open in CodeFlow

…e} (microsoft#16336)

scrollEnabled={false} must only disable user scroll gestures, matching iOS and
Android where setContentOffset / scrollToOffset still work when scrolling is
disabled. The scrollTo command (and scrollToIndex / scrollToOffset, which route
through it) previously hit a scrollEnabled early-return and was silently
dropped. User-gesture input is gated separately via m_scrollVisual.ScrollEnabled
(set from scrollEnabled in updateProps), so honoring a programmatic scroll here
does not re-enable user scrolling.

main-branch twin of microsoft#16304 (0.83-stable).
…d no-op NaN fontSize guard (microsoft#16317)

* fix(textinput): correct placeholder layout constraints (px vs DIP) and no-op NaN fontSize guard

Forward-port of microsoft#16303 (0.83-stable) to main.

CreatePlaceholderLayout fed m_imgWidth/m_imgHeight - which are physical
pixels (frame * pointScaleFactor) - into LayoutConstraints, which are
expressed in DIPs. The placeholder was laid out in a box pointScaleFactor
times too large, so it measured and positioned at a different height than
the typed text. Divide by pointScaleFactor.

The NaN fontSize guard was also a no-op: it evaluated
defaultTextAttributes().fontSize as a discarded expression statement
instead of assigning it, so a placeholder with no fontSize never picked
up the default.

* add beachball change file

* Update release type to prerelease

Change type from 'patch' to 'prerelease' for react-native-windows.

---------

Co-authored-by: Andrew Coates <30809111+acoates-ms@users.noreply.github.com>
…oft#16338)

onPointerPressed maps ActiveTouch.button exclusively from PointerUpdateKind, a
mouse-only concept. A touch or pen contact matches no case, falls through to
default: button = -1, and the derived W3C buttons bitmask becomes 0. The
pointerdown delivered to JS therefore claims no button is pressed, so
pointer-event-driven press handling discards finger contacts while identical
mouse clicks work.

Per W3C pointer-events a touch/pen contact IS the primary button: button 0,
buttons 1. Set that after the switch when the mouse mapping left it negative.

main counterpart of the button-labeling change in microsoft#16333 (0.83-stable), tracking
microsoft#16332. Ports only that change: main already covers the tag == -1 release leak
and the stale-pointer-reuse leak via microsoft#16048 (dispatching a synthesized touch
Cancel), and cancels capture loss per pointer. microsoft#16333's cancel-all loop,
IsPrimary purge and stale-touch backstop are deliberately not ported - they do
not exist on main and their necessity there has not been assessed.
…g OnPointerCaptureLost (microsoft#16337)

CapturePointer and releasePointerCapture look the capturing component up by its
cached m_pointerCapturingComponentTag and dereference the result unguarded. That
tag can outlive the component it names: when list/ScrollView virtualization
recycles the capturing row mid-pan, componentViewDescriptorWithTag returns a
descriptor whose .view is null, so winrt::get_self(...)->OnPointerCaptureLost()
dereferences null and terminates the process with 0xc0000005.

Null-check targetComponentView at both sites. Skipping the notify loses no state
transition: CapturePointer overwrites the stale tag immediately below, and
releasePointerCapture clears it via the existing m_capturedPointers.empty()
branch.

main twin of microsoft#16334 (0.83-stable).
Copilot AI balanced review requested due to automatic review settings August 21, 2026 20:42
@acoates-ms
Andrew Coates (acoates-ms) requested a review from a team as a code owner August 21, 2026 20:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Ports five Fabric fixes to the 0.81 branch.

Changes:

  • Corrects TextInput placeholder sizing and default font size.
  • Fixes pointer handling, capture crashes, and disabled ScrollView commands.
  • Corrects ownership tracking for outline visuals.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
WindowsTextInputComponentView.cpp Fixes placeholder layout.
ScrollViewComponentView.cpp Enables programmatic scrolling when disabled.
CompositionEventHandler.cpp Fixes touch buttons and stale capture handling.
BorderPrimitive.cpp Tracks owned outline visuals.
react-native-windows-touch-primary-button-main.json Adds pointer fix release entry.
react-native-windows-scrollto-scrollenabled-main.json Adds scrolling fix release entry.
react-native-windows-fix-textinput-placeholder-main.json Adds TextInput fix release entry.
react-native-windows-capture-null-guard-main.json Adds capture fix release entry.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread vnext/Microsoft.ReactNative/Fabric/Composition/BorderPrimitive.cpp
Copilot AI review requested due to automatic review settings August 21, 2026 21:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated no new comments.

Suppressed comments (2)

vnext/Microsoft.ReactNative/Fabric/Composition/BorderPrimitive.cpp:716

  • This backport omits the release change file that accompanies #16386. The other four ported fixes retain their change files, so the outline crash fix would be absent from generated release notes/versioning metadata. Please add the corresponding react-native-windows prerelease change entry for this fix.
    : m_outer(&outer), m_rootVisual(outer.CompositionContext().CreateSpriteVisual()), m_ownsRootVisual(true) {}

packages/@react-native-windows/cli/src/e2etest/createRnwApp.test.ts:1

  • This deletes the entire create-rnw-app E2E suite even though the PR is scoped to five Fabric bug-fix ports and none of those changes touches the CLI. Removing unrelated coverage can hide CLI/template regressions on 0.81; please restore this file and handle any branch-specific test retirement separately with its rationale and validation.

Copilot AI review requested due to automatic review settings August 21, 2026 22:03

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Suppressed comments (2)

vnext/Microsoft.ReactNative/Fabric/Composition/ScrollViewComponentView.cpp:1203

  • This no longer distinguishes programmatic scrolling from the custom scrollbar's user input. ScrollbarComponent::handleMoveThumb calls this same method (lines 340–351), and its press/move handlers do not check scrollEnabled; m_scrollVisual.ScrollEnabled does not gate that direct call. Consequently, a user can drag the thumb and scroll while scrollEnabled={false}. Keep the command path enabled while retaining a disabled check for scrollbar-thumb input (or split user and programmatic paths).
  // scrollEnabled={false} must only disable *user* scroll gestures, matching
  // iOS and Android where setContentOffset / scrollToOffset still work when
  // scrolling is disabled. Programmatic scrolls - the scrollTo command, and
  // scrollToIndex / scrollToOffset which route through it - previously hit a
  // scrollEnabled early-return here and were silently dropped. User-gesture
  // input is gated separately (m_scrollVisual.ScrollEnabled, set from
  // scrollEnabled in updateProps), so it is safe to always honor a
  // programmatic scroll here.
  m_scrollVisual.TryUpdatePosition(offset, animate);

vnext/Microsoft.ReactNative/Fabric/Composition/BorderPrimitive.cpp:716

  • This ports the runtime fix from #16386 but omits its accompanying react-native-windows change entry (change/react-native-windows-c1af9f4d-e4f1-4dea-9a73-b66033f3bb8d.json). Every other RNW fix in this PR adds a change file, so release tooling will otherwise omit the outline-crash fix from generated release notes. Please add the corresponding stable-branch change entry.
    : m_outer(&outer), m_rootVisual(outer.CompositionContext().CreateSpriteVisual()), m_ownsRootVisual(true) {}

@vmoroz
Vladimir Morozov (vmoroz) merged commit c6b95dd into microsoft:0.81-stable Aug 21, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants