Skip to content

Commit

Permalink
Merge pull request #686 from laravel/update-scroll-to
Browse files Browse the repository at this point in the history
[5.x] Ensure jQuery for scrollTo
  • Loading branch information
taylorotwell authored Oct 31, 2019
2 parents db4f8d7 + 5eb7fa5 commit cfffd19
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Browser.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,11 @@ public function move($x, $y)
*/
public function scrollTo($selector)
{
$this->ensurejQueryIsAvailable();

$selector = $this->resolver->format($selector);

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

return $this;
}
Expand Down

0 comments on commit cfffd19

Please sign in to comment.