MicrosoftEdge / MicrosoftEdge/WebView2Feedback
WebView2 is not contained within ScrollViewer
Nobody has claimed this yet.
- Dominant language
- PowerShell
- Stars
- 526
- Forks
- 67
- PR merge metrics
- No merged PRs in 30d
Description
Description
When placing a WebView2 into a ScrollViewer, it does not remain within the constraints of the ScrollViewer. The WebView2 will render above and below the ScrollViewer
Version
SDK: 1.0.705.50
Runtime: 88.0.705.63
Framework: WPF, .NET Framework 4.8
OS: Win10
Repro Steps
- Create a .NET Framework 4.8 WPF application.
- Add the WebView2 nuget package
- Replace MainWindow.xaml with the following
<Window x:Class="WpfWebView2_.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:wpf="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
mc:Ignorable="d"
Title="MainWindow" Height="500" Width="800"
MinWidth="450" MinHeight="500">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="50"/>
<RowDefinition Height="*"/>
<RowDefinition Height="50"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="300"/>
</Grid.ColumnDefinitions>
<Border Background="#2D2D30" Grid.ColumnSpan="2"/>
<Border Grid.Row="1" Grid.Column="1" BorderBrush="Black" BorderThickness="1">
<!--<sampleproject:SampleUserControl/>-->
<ScrollViewer>
<StackPanel>
<Rectangle Height="200" Fill="Blue"/>
<wpf:WebView2 Source="https://www.bing.com" Height="250"/>
<TextBlock TextWrapping="Wrap" Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."/>
<wpf:WebView2 Source="https://www.bing.com" Height="250"/>
<wpf:WebView2 Source="https://www.bing.com" Height="250"/>
<wpf:WebView2 Source="https://www.bing.com" Height="250"/>
</StackPanel>
</ScrollViewer>
</Border>
<Border Background="#2D2D30" Grid.ColumnSpan="2" Grid.Row="2"/>
</Grid>
</Window>
- Run the application - move the scroll bar up and down. Notice the WebView2 covers the gray bars
Screenshots


Additional context
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the provided MainWindow.xaml in a .NET Framework 4.8 WPF application, using the listed WebView2 SDK and runtime versions. Start by examining how the WebView2 controls behave inside the ScrollViewer while scrolling. Done means the WebView2 instances remain within the ScrollViewer and do not cover the surrounding gray bars.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100