Browse Source
Disable scroll chaining for ScrollVIewers in popup. (#20503 )
* feat: disable scroll chaining for AutoCompleteBox, ComboBox, and MenuScrollViewer.
* feat: disable scroll chaining for AutoCompleteBox, ComboBox, and MenuFlyoutPresenter
* feat: enable scroll chaining for ScrollViewer in MenuFlyoutPresenter.
pull/20529/head
Dong Bin
2 weeks ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with
8 additions and
2 deletions
src/Avalonia.Themes.Fluent/Controls/AutoCompleteBox.xaml
src/Avalonia.Themes.Fluent/Controls/ComboBox.xaml
src/Avalonia.Themes.Fluent/Controls/MenuScrollViewer.xaml
src/Avalonia.Themes.Simple/Controls/AutoCompleteBox.xaml
src/Avalonia.Themes.Simple/Controls/ComboBox.xaml
src/Avalonia.Themes.Simple/Controls/ScrollViewer.xaml
@ -66,7 +66,8 @@
BorderThickness="0"
Background="Transparent"
ItemTemplate="{TemplateBinding ItemTemplate}"
Margin="{DynamicResource AutoCompleteListPadding}" />
Margin="{DynamicResource AutoCompleteListPadding}"
ScrollViewer.IsScrollChainingEnabled="False" />
</Border>
</Popup>
</Grid>
@ -172,6 +172,7 @@
HorizontalAlignment="Stretch"
CornerRadius="{DynamicResource OverlayCornerRadius}">
<ScrollViewer HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
IsScrollChainingEnabled="False"
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
IsDeferredScrollingEnabled="{TemplateBinding (ScrollViewer.IsDeferredScrollingEnabled)}">
<ItemsPresenter Name="PART_ItemsPresenter"
@ -21,6 +21,7 @@
<ControlTheme x:Key="FluentMenuScrollViewer" TargetType="ScrollViewer">
<Setter Property="Background" Value="Transparent" />
<Setter Property="IsScrollChainingEnabled" Value="False" />
<Setter Property="Template">
<ControlTemplate>
<DockPanel>
@ -38,6 +38,7 @@
BorderThickness="0"
Foreground="{TemplateBinding Foreground}"
ItemTemplate="{TemplateBinding ItemTemplate}"
ScrollViewer.IsScrollChainingEnabled="False"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollBarVisibility="Auto" />
</Border>
@ -87,7 +87,8 @@
BorderThickness="1">
<ScrollViewer HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}"
IsDeferredScrollingEnabled="{TemplateBinding (ScrollViewer.IsDeferredScrollingEnabled)}">
IsDeferredScrollingEnabled="{TemplateBinding (ScrollViewer.IsDeferredScrollingEnabled)}"
ScrollViewer.IsScrollChainingEnabled="False">
<ItemsPresenter Name="PART_ItemsPresenter"
ItemsPanel="{TemplateBinding ItemsPanel}" />
</ScrollViewer>
@ -40,6 +40,7 @@
<ControlTheme x:Key="SimpleMenuScrollViewer"
TargetType="ScrollViewer">
<Setter Property="Background" Value="Transparent" />
<Setter Property="IsScrollChainingEnabled" Value="False" />
<Setter Property="Template">
<ControlTemplate>
<DockPanel>