@@ -1003,11 +1003,11 @@ public function scrollIntoView(string $elementId, int $yOffset = 70): void
10031003 {
10041004 // 70pt offset by-default so that the topmenu does not cover the element
10051005 $ script = <<<'JS'
1006- const elementId = arguments[0];
1007- const yOffset = arguments[1];
1008- const position = document.getElementById(elementId).getBoundingClientRect();
1009- window.scrollBy({left: 0, top: position.top - yOffset, behavior: 'instant'});
1010- JS;
1006+ const elementId = arguments[0];
1007+ const yOffset = arguments[1];
1008+ const position = document.getElementById(elementId).getBoundingClientRect();
1009+ window.scrollBy({left: 0, top: position.top - yOffset, behavior: 'instant'});
1010+ JS;
10111011 $ this ->webDriver ->executeScript ($ script , [$ elementId , $ yOffset ]);
10121012 }
10131013
@@ -1021,10 +1021,10 @@ public function scrollIntoView(string $elementId, int $yOffset = 70): void
10211021 public function scrollToElement (WebDriverElement $ element , int $ xOffset = 0 , int $ yOffset = 0 ): void
10221022 {
10231023 $ script = <<<'JS'
1024- const leftValue = arguments[0];
1025- const topValue = arguments[1];
1026- window.scrollBy({left: leftValue, top: topValue, behavior: 'instant'});
1027- JS;
1024+ const leftValue = arguments[0];
1025+ const topValue = arguments[1];
1026+ window.scrollBy({left: leftValue, top: topValue, behavior: 'instant'});
1027+ JS;
10281028 $ this ->webDriver ->executeScript ($ script , [
10291029 $ element ->getLocation ()->getX () + $ xOffset ,
10301030 $ element ->getLocation ()->getY () + $ yOffset ,
@@ -1037,8 +1037,8 @@ public function scrollToElement(WebDriverElement $element, int $xOffset = 0, int
10371037 public function scrollToBottom (): void
10381038 {
10391039 $ script = <<<'JS'
1040- window.scrollTo({left: 0, top: document.body.scrollHeight, behavior: 'instant'});
1041- JS;
1040+ window.scrollTo({left: 0, top: document.body.scrollHeight, behavior: 'instant'});
1041+ JS;
10421042 $ this ->webDriver ->executeScript ($ script );
10431043 }
10441044
0 commit comments