-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix XAML popup positioning and light dismiss in ScrollView (#15557) #15564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Nitin-100
wants to merge
7
commits into
microsoft:main
Choose a base branch
from
Nitin-100:nitinc/fix-xaml-popup-positioning-15557
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Fix XAML popup positioning and light dismiss in ScrollView (#15557) #15564
Nitin-100
wants to merge
7
commits into
microsoft:main
from
Nitin-100:nitinc/fix-xaml-popup-positioning-15557
+528
−153
Conversation
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
…#15557) - Add SetXamlRoot() API on ContentIslandComponentView for 3rd party XAML components - Add DismissPopups() using VisualTreeHelper.GetOpenPopupsForXamlRoot() - Fire LayoutMetricsChanged on scroll to update popup positions - Dismiss child ContentIsland popups when scroll begins - Add ComboBox sample component demonstrating the pattern - Add xamlPopupBug test sample for playground-composition
sundaramramaswamy
requested changes
Jan 23, 2026
Contributor
sundaramramaswamy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please address comments.
…#15557) - Set LocalToParentTransformMatrix synchronously before Connect() to fix initial position - Fire LayoutMetricsChanged on scroll to update position after scrolling - Add DismissPopupsRequest event for 3P components to implement light dismiss - Update ComboBox sample to use event-based approach (core remains XAML-agnostic)
Issue microsoft#15557: Fix popup positioning for XAML controls in ScrollView Bug 1 (Position Fix): - Convert getClientRect() physical pixels to DIPs by dividing by pointScaleFactor - LocalToParentTransformMatrix expects logical pixels (DIPs), not physical pixels - Update transform synchronously instead of async to avoid race conditions - Set initial transform in OnMounted() before Connect() Bug 2 (Light Dismiss Fix): - Add DismissPopupsRequest event for 3P components to handle popup dismissal - ScrollView fires event when scroll begins via DismissChildContentIslandPopups() - Core remains XAML-agnostic - 3P components handle their own popups
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.
Description
This PR fixes Issue #15557 - "Pop-ups of Xaml controls need positioning and dismissal"
When XAML controls with popups (like ComboBox, DatePicker, TimePicker) are hosted inside a React Native ScrollView via
ContentIslandComponentView, two bugs occur:Root Cause Analysis
Bug 1: Popup Position
ContentIslandComponentViewusesChildSiteLink.LocalToParentTransformMatrixfor popup positioninggetClientRect()returns values in physical pixels (scaled bypointScaleFactor), butLocalToParentTransformMatrixexpects logical pixels (DIPs)UIDispatcher().Post(), causing race conditions where popup opened with stale transform valuesConnect(), causing wrong position even without scrollingBug 2: Light Dismiss on Scroll
Solution
Bug 1 Fix: Popup Position After Scroll
getClientRect()values bypointScaleFactorbefore settingLocalToParentTransformMatrixUIDispatcher().Post()wrapper - update transform immediatelyLocalToParentTransformMatrixinOnMounted()beforeConnect()ScrollViewComponentViewfiresLayoutMetricsChangedevent when scroll position changesBug 2 Fix: Light Dismiss on Scroll
DismissPopupsRequestevent toContentIslandComponentViewScrollViewComponentViewrecursively finds allContentIslandComponentViewchildren and firesFireDismissPopupsRequest()Files Changed
Core Fix (vnext/Microsoft.ReactNative/)
Fabric/Composition/ContentIslandComponentView.cpp- DIP conversion, sync updates, DismissPopupsRequest eventFabric/Composition/ScrollViewComponentView.cpp- Fire LayoutMetricsChanged on scroll, dismiss popups on scroll beginTesting
XamlPopupReprosample in Playground##Screenshot
testingFix.mp4