Skip to content

Commit 8b3aa8b

Browse files
authored
ElementHandle.ScrollIntoViewIfNeededAsync public (#1984)
So that the user can choose a variable point where to press in the button
1 parent 664ca05 commit 8b3aa8b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/PuppeteerSharp/ElementHandle.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -693,7 +693,12 @@ private IEnumerable<BoxModelPoint> IntersectQuadWithViewport(IEnumerable<BoxMode
693693
Y = Math.Min(Math.Max(point.Y, 0), viewport.ContentSize.Height),
694694
});
695695

696-
private async Task ScrollIntoViewIfNeededAsync()
696+
/// <summary>
697+
/// If the element is not already fully visible then scrolls the element's parent container such that the element on
698+
/// which ScrollIntoViewIfNeededAsync() is called is visible to the user.
699+
/// </summary>
700+
/// <returns>A Task that resolves when the message was confirmed by the browser</returns>
701+
public async Task ScrollIntoViewIfNeededAsync()
697702
{
698703
var errorMessage = await EvaluateFunctionAsync<string>(
699704
@"async(element, pageJavascriptEnabled) => {

0 commit comments

Comments
 (0)