Skip to content

Commit cfffd19

Browse files
authored
Merge pull request #686 from laravel/update-scroll-to
[5.x] Ensure jQuery for scrollTo
2 parents db4f8d7 + 5eb7fa5 commit cfffd19

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Browser.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,11 @@ public function move($x, $y)
287287
*/
288288
public function scrollTo($selector)
289289
{
290+
$this->ensurejQueryIsAvailable();
291+
290292
$selector = $this->resolver->format($selector);
291293

292-
$this->driver->executeScript("$(\"html, body\").animate({scrollTop: $(\"$selector\").offset().top}, 0);");
294+
$this->driver->executeScript("jQuery(\"html, body\").animate({scrollTop: jQuery(\"$selector\").offset().top}, 0);");
293295

294296
return $this;
295297
}

0 commit comments

Comments
 (0)