microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.2k stars 669 forks source link

NumberBox's compact SpinButton can scroll off window #9730

Open HO-COOH opened 1 month ago

HO-COOH commented 1 month ago

Describe the bug

As title suggest.

Steps to reproduce the bug

Click to open the SpinButton of a NumberBox, scroll the page.

Expected behavior

No response

Screenshots

numberbox2

NuGet package version

WinUI 3 - Windows App SDK 1.5.4: 1.5.240607001

Windows version

Windows 11 (22H2): Build 22621

Additional context

No response

github-actions[bot] commented 1 month ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

Lightczx commented 1 month ago

You can see here: https://github.com/microsoft/microsoft-ui-xaml/blob/98a60c8f30c84f297a175dd2884d54ecd1c8a4a9/controls/dev/NumberBox/NumberBox.xaml#L113

ShouldConstrainToRootBounds="False"

and let's see what happen for UWP/WinUI2 image

So I believe it's microsoft's intention.

lolametro commented 1 month ago

The ShouldConstrainToRootBounds="False" is more likely there to allow for acrylic effect.

Lightczx commented 1 month ago

The ShouldConstrainToRootBounds="False" is more likely there to allow for acrylic effect.

ShouldConstrainToRootBounds="True" can also have in app acrylic, Set this to false in WinUI3 can allow user interact the popup by mouse over a custom titlebar which set by ExtentedContentIntoTitleBar, while ShouldConstrainToRootBounds="False" will casue the popup render below the titlebar and can't be accessed.

kmahone commented 1 week ago

NumberBox should use EffectiveViewportChanged to close the popup whenever the NumberBox itself moves around in the scroll view. That would prevent this problem.