-
Notifications
You must be signed in to change notification settings - Fork 831
fix: Dialog prevents scroll #21987
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
base: master
Are you sure you want to change the base?
fix: Dialog prevents scroll #21987
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes a bug where dialogs were preventing scrolling in background content. The fix adds a check in ScrollContentPresenter.Managed.cs to respect already-handled pointer events, preventing the scroll presenter from enabling direct manipulation on events that dialogs or other controls have already processed. A new sample (ColorPickerDialogSample) is included to demonstrate and test the fix.
- Added
args.Handledcheck inTryEnableDirectManipulationto prevent scroll conflicts when dialogs handle pointer events - Created a sample application with a
ContentDialogcontaining aColorPickerand backgroundScrollViewerto test the fix - Added project file entries to include the new sample files in the build
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/Uno.UI/UI/Xaml/Controls/ScrollContentPresenter/ScrollContentPresenter.Managed.cs | Core fix: Added check for args.Handled to prevent enabling direct manipulation on already-handled pointer events |
| src/SamplesApp/UITests.Shared/UITests.Shared.projitems | Added project references for the new ColorPickerDialog sample files and removed trailing whitespace |
| src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/ColorPickerTests/ColorPickerDialogSample.xaml.cs | Code-behind for the sample page that demonstrates the dialog scroll fix |
| src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/ColorPickerTests/ColorPickerDialogSample.xaml | XAML for the sample page with a scrollable area and button to show the dialog |
| src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/ColorPickerTests/ColorPickerDialog.xaml.cs | Code-behind for the ContentDialog containing a ColorPicker |
| src/SamplesApp/UITests.Shared/Microsoft_UI_Xaml_Controls/ColorPickerTests/ColorPickerDialog.xaml | XAML definition for the ContentDialog with ColorPicker control |
| private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) | ||
| { | ||
| } | ||
|
|
||
| private void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) | ||
| { | ||
| } |
Copilot
AI
Nov 27, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These empty event handlers (ContentDialog_PrimaryButtonClick and ContentDialog_SecondaryButtonClick) appear to be unused. If these handlers are not needed for the sample's functionality, consider removing them along with their corresponding event subscriptions in the XAML (lines 7 and 9 in ColorPickerDialog.xaml) to keep the code clean and maintainable.
| private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) | |
| { | |
| } | |
| private void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args) | |
| { | |
| } |
|
π€ Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21987/docs/index.html |
|
π€ Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21987/wasm-skia-net9/index.html |
|
|
2649ffa to
b0759fe
Compare
|
π€ Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21987/docs/index.html |
|
π€ Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-21987/wasm-skia-net9/index.html |
|
|
GitHub Issue: closes
PR Type: π Bugfix
What is the current behavior? π€
What is the new behavior? π
PR Checklist β
Please check if your PR fulfills the following requirements:
Screenshots Compare Test Runresults.Other information βΉοΈ