Skip to content
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

[Fabric] Use PopupWindowSiteBridge for Modal when USE_EXPERIMENTAL_WINUI3 is true #14284

Merged
merged 8 commits into from
Jan 28, 2025

Conversation

TatianaKapos
Copy link
Contributor

@TatianaKapos TatianaKapos commented Jan 16, 2025

Description

Implements Modal using PopupWindowSiteBridge when USE_EXPERIMENTAL_WINUI3 is true

Type of Change

  • New feature (non-breaking change which adds functionality)

Why

ADO Deliverable 54612062

What

Changes Modal to use PopupWindowSiteBridge when USE_EXPERIMENTAL_WINUI3 is set to true. Also fixed an error in ReactNativeIsland where when closing a Modal, it would unmount the actual rootView instead of modal's rootView due to an extra call in m_islandDisconnectedToken.

Screenshots

Playground-composition_R25E8qPsLx.mp4

Testing

tested locally

Changelog

no

Microsoft Reviewers: Open in CodeFlow

@TatianaKapos TatianaKapos changed the title [Draft] Use PopupWindowSiteBridge for Modal when USE_EXPERIMENTAL_WINUI3 is true [Fabric] Use PopupWindowSiteBridge for Modal when USE_EXPERIMENTAL_WINUI3 is true Jan 22, 2025
@TatianaKapos TatianaKapos marked this pull request as ready for review January 22, 2025 22:01
@TatianaKapos TatianaKapos requested a review from a team as a code owner January 22, 2025 22:01
// get the root hwnd
m_prevWindowID =
winrt::Microsoft::ReactNative::ReactCoreInjection::GetTopLevelWindowId(view.ReactContext().Properties());

m_parentHwnd =
view.as<::Microsoft::ReactNative::Composition::Experimental::IComponentViewInterop>()->GetHwndForParenting();

#ifdef USE_EXPERIMENTAL_WINUI3
m_bridge = winrt::Microsoft::UI::Content::DesktopChildSiteBridge::Create(
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi, I'm trying to understand what the DesktopChildSiteBridge "m_bridge" is for.

When USE_EXPERIMENTAL_WINUI3 is false: it looks like this is parented to the AppWindow's HWND, which is the new top-level HWND for the popup.

When USE_EXPERIMENTAL_WINUI3 is true: it looks like we parent this to the existing HWND, and don't hook up any content to it. I'm guessing we're doing this b/c it's the only way right now to create a PopupWindowSiteBridge.

is that correct? Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes! It's currently the only way to create a PopupWindowSiteBridge, then I just used PopupWindowSiteBridge for the navigation host.

but I did realize I wasn't setting the TopLevelWindowID here, just fixed that!

@TatianaKapos TatianaKapos merged commit 60909d3 into microsoft:main Jan 28, 2025
63 checks passed
@TatianaKapos TatianaKapos deleted the tk-testIXP2 branch January 28, 2025 23:03
acoates-ms pushed a commit to acoates-ms/react-native-windows that referenced this pull request Jan 29, 2025
…NUI3 is true (microsoft#14284)

* add modal implementation with PopupWindowSiteBridge

* Change files

* add conditional

* feedback
acoates-ms added a commit that referenced this pull request Jan 31, 2025
… factor (#14318)

* Fix crash when currently focused element gets marked as enableFocusRing=false (#14306)

* Fix crash when currently focused element gets marked as enableFocusRing=false

* Change files

* [Fabric] Use PopupWindowSiteBridge for Modal when USE_EXPERIMENTAL_WINUI3 is true (#14284)

* add modal implementation with PopupWindowSiteBridge

* Change files

* add conditional

* feedback

* Initial support for UIA and tab navigation for a child Island (#14305)

* Basic support for stitching the UIA tree for a ContentIslandComponentView's child

* Updated comment

* Change files

* Support shift+tab, and move Automation event handlers to ContentIslandComponentView

* Allow portals to have independent layout constraints and scale factor (#14315)

* Allow portals to have independent layout constraints and scale factor

* format

* change files

* fix

* Round Focus visuals by default, fix nudge rendering (#14312)

* Round Focus visuals by default, fix nudge rendering

* Change files

* change files

* fix

* fix

* fix

---------

Co-authored-by: Tatiana Kapos <[email protected]>
Co-authored-by: JesseCol <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants