Skip to content

Commit 3401db0

Browse files
committed
disable element on screen check
1 parent 3d03ce7 commit 3401db0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Microsoft.Toolkit.Uwp.UI.Controls.Input/RichSuggestBox/RichSuggestBox.Helpers.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@ public partial class RichSuggestBox
2020
{
2121
private static bool IsElementOnScreen(FrameworkElement element, double offsetX = 0, double offsetY = 0)
2222
{
23+
// DisplayInformation only works in UWP. No alternative to get DisplayInformation.ScreenHeightInRawPixels
24+
// Tracking issues:
25+
// https://github.com/microsoft/WindowsAppSDK/issues/114
26+
// https://github.com/microsoft/microsoft-ui-xaml/issues/4228
27+
// TODO: Remove when DisplayInformation.ScreenHeightInRawPixels alternative is available
28+
return true;
29+
30+
#pragma warning disable CS0162 // Unreachable code detected
2331
if (Window.Current == null)
2432
{
2533
return !ControlHelpers.IsXamlRootAvailable || element.XamlRoot.IsHostVisible;
@@ -35,6 +43,7 @@ private static bool IsElementOnScreen(FrameworkElement element, double offsetX =
3543
var scaleFactor = displayInfo.RawPixelsPerViewPixel;
3644
var displayHeight = displayInfo.ScreenHeightInRawPixels;
3745
return elementBounds.Top * scaleFactor >= 0 && elementBounds.Bottom * scaleFactor <= displayHeight;
46+
#pragma warning restore CS0162 // Unreachable code detected
3847
}
3948

4049
private static bool IsElementInsideWindow(FrameworkElement element, double offsetX = 0, double offsetY = 0)

0 commit comments

Comments
 (0)