-
Notifications
You must be signed in to change notification settings - Fork 742
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Use preventDefault to prevent browser from processing Handled e…
…vents chore: Prevent default only for non-Pointer events chore: Comment
- Loading branch information
1 parent
0a39f2e
commit 974f689
Showing
5 changed files
with
97 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
src/SamplesApp/UITests.Shared/Windows_UI_Input/PointersTests/ScrollHandled.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<Page | ||
x:Class="UITests.Windows_UI_Input.PointersTests.ScrollHandled" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:UITests.Windows_UI_Input.PointersTests" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> | ||
|
||
<Grid> | ||
<ScrollViewer> | ||
<StackPanel PointerWheelChanged="OnPointerWheelChanged"> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
<Button>Test</Button> | ||
</StackPanel> | ||
</ScrollViewer> | ||
</Grid> | ||
</Page> |
21 changes: 21 additions & 0 deletions
21
src/SamplesApp/UITests.Shared/Windows_UI_Input/PointersTests/ScrollHandled.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using Uno.UI.Samples.Controls; | ||
using Windows.UI.Core; | ||
using Windows.UI.Xaml.Controls; | ||
using Windows.UI.Xaml.Input; | ||
|
||
namespace UITests.Windows_UI_Input.PointersTests | ||
{ | ||
[Sample("Pointers", Description = "When scroll wheel is used while hovering above the buttons, it should not scroll. When scroll wheel is used above the page's blank area, it should scroll.")] | ||
public sealed partial class ScrollHandled : Page | ||
{ | ||
public ScrollHandled() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
private void OnPointerWheelChanged(object sender, PointerRoutedEventArgs args) | ||
{ | ||
args.Handled = true; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters