Skip to content

Conversation

@Nitin-100
Copy link
Contributor

@Nitin-100 Nitin-100 commented Nov 21, 2025

Cherry-picked commits (in order):

dacbadc - ContextMenu implementation in Fabric as per Parity to Paper (#15339)
9490b2f - TextAlign and WritingDirection Parity for Fabric TextInput (#15340)
40c0967 - PagingEnabled Parity for Fabric ScrollView (#15341)

Microsoft Reviewers: Open in CodeFlow

vineethkuttan and others added 15 commits November 5, 2025 13:27
#15309)

* Disable the deep import warning

* Change files

* Align index.windows.js with core

* Change files
…ec files (#15096)

* Initial plan

* Fix init-windows template to use conditional codegen includes

Co-authored-by: anupriya13 <54227869+anupriya13@users.noreply.github.com>

* Automatically detect existing codegen spec files instead of using hardcoded names

Co-authored-by: anupriya13 <54227869+anupriya13@users.noreply.github.com>

* Add explanatory comments about Mustache template syntax for C++ developers

Co-authored-by: sundaramramaswamy <29264916+sundaramramaswamy@users.noreply.github.com>

* Change files

* Run yarn change prerelease and yarn lint:fix

Co-authored-by: anupriya13 <54227869+anupriya13@users.noreply.github.com>

* Revert unrelated changes to FlatList-multiColumn.windows.js

Co-authored-by: anupriya13 <54227869+anupriya13@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: anupriya13 <54227869+anupriya13@users.noreply.github.com>
Co-authored-by: sundaramramaswamy <29264916+sundaramramaswamy@users.noreply.github.com>
Co-authored-by: Sundaram Ramaswamy <suramaswamy@microsoft.com>
* Realign View.js with upstream

* Change files

* fix

* fix

* update snapshots
* visual studio 2026 strict check fix

* Fix  Crash after closing DesktopPopupSiteBridge

* Change files

* yarn lint:fix amd format

* remove debug logs

* Revert "visual studio 2026 strict check fix"

* visual studio 2026 strict check fix

* nit comment
* metro config fix

* Change files
* Change files

* Implement context menu support for Fabric TextInput with contextMenuHidden property

* Fix beachball change file - add meaningful comment

* Fix context menu Paste option to check clipboard content

- Added clipboard content check using IsClipboardFormatAvailable(CF_UNICODETEXT)
- Paste menu item now only enabled when clipboard has text AND field is editable
- Fixes bug where Cut/Copy/Paste showed even when text field was empty
- Matches XAML TextBox automatic clipboard state checking behavior

Menu item logic now matches Paper:
- Cut: requires selection AND editable
- Copy: requires selection only
- Paste: requires editable AND clipboard has text content
- Select All: requires non-empty text AND editable

* Fix context menu to show on button release (WM_RBUTTONUP) instead of press

---------

Co-authored-by: Nitin Chaudhary <nitchaudhary@microsoft.com>
* Change files

* Implement textAlign justify and writingDirection support in Fabric TextInput

- Add support for textAlign='justify' using PFA_JUSTIFY flag
- Implement writingDirection (baseWritingDirection) support for 'ltr', 'rtl', and 'auto'
- Make textAlign='auto' (Natural) respect RTL writing direction
- Set PFM_RTLPARA and PFE_RTLPARA flags for RTL text
- Achieves full parity with Paper XAML implementation

* Fix beachball change file - add meaningful comment

* Add textAlign and writingDirection support to TextInput and text layout

- TextInput now properly handles textAlign (Left, Right, Center, Justified, Natural)
- TextInput now properly handles writingDirection/baseWritingDirection (LTR, RTL, Natural)
- WritingDirection::Natural uses layoutMetrics.layoutDirection since direction can be
  overridden at any point in the tree
- Added matching support in WindowsTextLayoutManager for text measurement
- WindowsTextLayoutManager now sets DWRITE_READING_DIRECTION based on baseWritingDirection
- TextAlignment::Natural now respects reading direction (RTL = trailing, LTR = leading)
- Fixes layout affecting flags that impact text measurement throughout the system

* Fix reading direction to only apply when explicitly set

- Only call SetReadingDirection when baseWritingDirection is explicitly specified
- Avoids breaking existing text layouts that don't specify writingDirection
- Fixes LegacyControlStyleTest snapshot failure
- Natural alignment still respects RTL when baseWritingDirection is set

---------

Co-authored-by: Nitin Chaudhary <nitchaudhary@microsoft.com>
* Implement pagingEnabled prop for Fabric ScrollView

- Add pagingEnabled boolean member to CompScrollerVisual
- Implement PagingEnabled() method in IScrollVisual interface
- Generate viewport-sized snap points when pagingEnabled=true
- Wire up pagingEnabled prop in ScrollViewComponentView::updateProps()
- Achieves parity with Paper ScrollView pagingEnabled support

* Implement pagingEnabled property for Fabric ScrollView

- Added bool m_pagingEnabled member to CompScrollerVisual
- Implemented PagingEnabled() method in IScrollVisual interface
- Generate viewport-sized snap points when pagingEnabled=true
- Wired up prop handling in ScrollViewComponentView
- snapToOffsets disables pagingEnabled (matches Paper/iOS/Android behavior)
- Excludes snapToEnd when pagingEnabled to avoid conflicts
- Validates viewport size before generating snap points
- Reconfigures snap points when size changes and paging is enabled

Achieves full parity with Paper XAML and cross-platform React Native behavior.

* Implement snapToInterval and snapToAlignment for Fabric ScrollView

Added complete snap point parity with Paper/iOS/Android:

1. pagingEnabled: Snaps to viewport-size intervals
   - Already implemented in previous commit
   - Full page-by-page scrolling behavior

2. snapToInterval: Snaps to fixed interval multiples
   - More flexible than pagingEnabled
   - Works with any interval value
   - Generates snap points at: 0, interval, 2*interval, 3*interval, ... maxScroll

3. snapToAlignment: Controls snap point alignment
   - Values: 'start' (Near), 'center' (Center), 'end' (Far)
   - Only applies when snapToInterval is set
   - Start: no offset (default)
   - Center: offset = -viewport/2
   - End: offset = -viewport

Priority hierarchy matches React Native official behavior:
- snapToOffsets (highest) > snapToInterval > pagingEnabled > snapToStart/snapToEnd

Implementation:
- Added SnapPointsAlignment enum to CompositionSwitcher.idl
- Added m_snapToInterval and m_snapToAlignment members to CompScrollerVisual
- Implemented SnapToInterval() and SnapToAlignment() methods
- Updated ConfigureSnapInertiaModifiers() with priority-based snap point generation
- Wired props in ScrollViewComponentView::updateProps()
- snapToOffsets disables both snapToInterval and pagingEnabled

Matches Paper's SnapPointManagingContentControl behavior where:
- GetRegularSnapPoints() returns m_interval when set
- SnapToOffsets() sets m_interval = 0 (disables it)
- XAML SnapPointsAlignment maps to: Near=start, Center=center, Far=end

* Fix snapToInterval type - Float not optional

* Update change file and fix formatting for snap point implementation

---------

Co-authored-by: Nitin Chaudhary <nitchaudhary@microsoft.com>
@Nitin-100 Nitin-100 requested review from a team as code owners November 21, 2025 04:53
@vineethkuttan
Copy link
Contributor

Raise PR against 0.81 stable branch, you have raised for main.

@Nitin-100
Copy link
Contributor Author

Raise PR against 0.81 stable branch, you have raised for main.

I raised it on the 0.81 stable , how the hell this went to main, let me check

@Nitin-100 Nitin-100 closed this Nov 24, 2025
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.

7 participants