Skip to content

Commit

Permalink
Reapply "Draging (which involves a click) also needs to scroll into v…
Browse files Browse the repository at this point in the history
…iew"

This reverts commit 761ea2e.
  • Loading branch information
alexpott committed Jul 31, 2024
1 parent 761ea2e commit fff9d26
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Selenium2Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -1023,16 +1023,17 @@ public function dragTo(string $sourceXpath, string $destinationXpath)
$destination = $this->findElement($destinationXpath);

if ($this->isW3C()) {
$this->scrollElementIntoView($source);
$actions = array(
'actions' => [
[
'type' => 'pointer',
'id' => 'mouse1',
'parameters' => ['pointerType' => 'mouse'],
'actions' => [
['type' => 'pointerMove', 'duration' => 0, 'origin' => [Element::WEB_ELEMENT_ID => $this->findElement($sourceXpath)->getID()], 'x' => 0, 'y' => 0],
['type' => 'pointerMove', 'duration' => 0, 'origin' => [Element::WEB_ELEMENT_ID => $source->getID()], 'x' => 0, 'y' => 0],
['type' => 'pointerDown', "button" => 0],
['type' => 'pointerMove', 'duration' => 0, 'origin' => [Element::WEB_ELEMENT_ID => $this->findElement($destinationXpath)->getID()], 'x' => 0, 'y' => 0],
['type' => 'pointerMove', 'duration' => 0, 'origin' => [Element::WEB_ELEMENT_ID => $destination->getID()], 'x' => 0, 'y' => 0],
['type' => 'pointerUp', "button" => 0],
],
],
Expand Down

0 comments on commit fff9d26

Please sign in to comment.