scroll method

  1. @override
Future<void> scroll({
  1. int? x,
  2. int? y,
})
override

Scrolls this element in x and/or y direction by pixels.

ScrollOptions is currently not supported. https://developer.mozilla.org/en-US/docs/Web/API/Element/scroll

Implementation

@override
Future<void> scroll({int? x, int? y}) async =>
    _retryWhenStale(() => _driver.execute(
        'arguments[0].scrollLeft += ${x ?? 0};'
        'arguments[0].scrollTop += ${y ?? 0};'
        'arguments[0].dispatchEvent(new Event("scroll"));',
        [_single]));