Skip to content

Commit 7ce0f31

Browse files
[0.80][Fabric] Fix UIA Clipped Property for Modal Component (#15184)
* [Fabric] Fixing Clipped Property for Modal Component (#15176) * Fixing Clipped Property for Modal Component * Yarn Change * Removed try catch. * Review Changes
1 parent e479303 commit 7ce0f31

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "[Fabric] Fixing Clipped Property for Modal Component",
4+
"packageName": "react-native-windows",
5+
"email": "[email protected]",
6+
"dependentChangeType": "patch"
7+
}

vnext/Microsoft.ReactNative/Fabric/Composition/CompositionDynamicAutomationProvider.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,18 @@ HRESULT __stdcall CompositionDynamicAutomationProvider::GetPropertyValue(PROPERT
561561
}
562562
case UIA_IsOffscreenPropertyId: {
563563
pRetVal->vt = VT_BOOL;
564-
pRetVal->boolVal = (compositionView->getClipState() == ClipState::FullyClipped) ? VARIANT_TRUE : VARIANT_FALSE;
564+
565+
// Check if element is offscreen - consider modal content special case
566+
bool isOffscreen = (compositionView->getClipState() == ClipState::FullyClipped);
567+
568+
// Modal content may appear clipped but is visible in its own window
569+
if (isOffscreen) {
570+
if (const auto hwnd = compositionView->GetHwndForParenting()) {
571+
isOffscreen = !(IsWindowVisible(hwnd) && !IsIconic(hwnd));
572+
}
573+
}
574+
575+
pRetVal->boolVal = isOffscreen ? VARIANT_TRUE : VARIANT_FALSE;
565576
break;
566577
}
567578
case UIA_HelpTextPropertyId: {

0 commit comments

Comments
 (0)