Skip to content

Commit

Permalink
Fixed unwanted trailing tab in chrome 53
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorin committed Sep 14, 2016
1 parent 22c1085 commit e2710a2
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Selenium2Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -676,12 +676,11 @@ public function setValue($xpath, $value)

if (in_array($elementName, array('input', 'textarea'))) {
$existingValueLength = strlen($element->attribute('value'));
// Add the TAB key to ensure we unfocus the field as browsers are triggering the change event only
// after leaving the field.
$value = str_repeat(Key::BACKSPACE . Key::DELETE, $existingValueLength) . $value . Key::TAB;
$value = str_repeat(Key::BACKSPACE . Key::DELETE, $existingValueLength) . $value;
}

$element->postValue(array('value' => array($value)));
$this->executeScript("document.activeElement && document.activeElement.blur()");
}

/**
Expand Down

0 comments on commit e2710a2

Please sign in to comment.