Skip to content

Conversation

@MartinZikmund
Copy link
Member

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:

Other information ℹ️

Copilot AI review requested due to automatic review settings November 27, 2025 16:38
@github-actions github-actions bot added the area/automation Categorizes an issue or PR as relevant to project automation label Nov 27, 2025
Copilot finished reviewing on behalf of MartinZikmund November 27, 2025 16:40
Copy link
Contributor

Copilot AI left a 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.Handled check in TryEnableDirectManipulation to prevent scroll conflicts when dialogs handle pointer events
  • Created a sample application with a ContentDialog containing a ColorPicker and background ScrollViewer to 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

Comment on lines +21 to +27
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
}

private void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
}
Copy link

Copilot AI Nov 27, 2025

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.

Suggested change
private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
}
private void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
}

Copilot uses AI. Check for mistakes.
@unodevops
Copy link
Contributor

πŸ€– Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21987/docs/index.html

@unodevops
Copy link
Contributor

πŸ€– 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

@unodevops
Copy link
Contributor

⚠️⚠️ The build 185422 has failed on Uno.UI - CI.

@MartinZikmund MartinZikmund force-pushed the dev/mazi/dialog-prevents-scroll branch from 2649ffa to b0759fe Compare November 28, 2025 13:37
@unodevops
Copy link
Contributor

πŸ€– Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-21987/docs/index.html

@unodevops
Copy link
Contributor

πŸ€– 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

@unodevops
Copy link
Contributor

⚠️⚠️ The build 185602 has failed on Uno.UI - CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/automation Categorizes an issue or PR as relevant to project automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants