scrollToElement method

Future<Online> scrollToElement(
  1. AbstractSelector selector
)

Implementation

Future<Online> scrollToElement(AbstractSelector selector) async {
  Show.action('scrolling', 'to', selector.selector);
  await (await page).waitForSelector(selector.selector);
  await (await page).evaluate('''(selector) => {
    document.querySelector(selector).scrollIntoView();
  }''', args: [selector.selector]);
  return this;
}