[0.81] Port textinput fixes and outline property fix - #16387
Conversation
…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).
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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-windowsprerelease 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.
There was a problem hiding this comment.
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::handleMoveThumbcalls this same method (lines 340–351), and its press/move handlers do not checkscrollEnabled;m_scrollVisual.ScrollEnableddoes not gate that direct call. Consequently, a user can drag the thumb and scroll whilescrollEnabled={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-windowschange 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) {}
c6b95dd
into
microsoft:0.81-stable
Port #16336, #16317, #16338, #16337, and #16386 to 0.81
Microsoft Reviewers: Open in CodeFlow