Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "[Fabric] Fixing Clipped Property for Modal Component",
"packageName": "react-native-windows",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Copy link
Contributor

@sundaramramaswamy sundaramramaswamy Oct 8, 2025

Choose a reason for hiding this comment

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

Nice, thanks, it's very readable now :)

Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,29 @@ HRESULT __stdcall CompositionDynamicAutomationProvider::GetPropertyValue(PROPERT
}
case UIA_IsOffscreenPropertyId: {
pRetVal->vt = VT_BOOL;
pRetVal->boolVal = (compositionView->getClipState() == ClipState::FullyClipped) ? VARIANT_TRUE : VARIANT_FALSE;

// Special handling for modal content - check if component is in a popup/modal window
bool isOffscreen = true;
auto clipState = compositionView->getClipState();

if (clipState != ClipState::FullyClipped) {
isOffscreen = false;
} else {
// Component appears clipped, but check if it's modal content
// Modal content may appear clipped due to lack of parent relationships
// but should still be considered visible if it's in its own window
if (auto hwnd = compositionView->GetHwndForParenting()) {
// Check if this window is visible and not minimized
if (IsWindowVisible(hwnd) && !IsIconic(hwnd)) {
isOffscreen = false; // Window is visible, so content is not offscreen
}
} else {
// If we can't get window info, fall back to clip state
isOffscreen = true;
}
}

pRetVal->boolVal = isOffscreen ? VARIANT_TRUE : VARIANT_FALSE;
break;
}
case UIA_HelpTextPropertyId: {
Expand Down
Loading