Navigation Menu

Skip to content

Commit

Permalink
BUG Fixing tabindex added to CreditCardField when tabindex is NULL
Browse files Browse the repository at this point in the history
The tabindex increment *should* only be done if there is a tabindex
that has been set on a CreditCardField already, otherwise it breaks
the tab ordering.
  • Loading branch information
Sean Harvey committed Sep 19, 2013
1 parent a7f38f7 commit c453ea3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions forms/CreditCardField.php
Expand Up @@ -35,6 +35,9 @@ public function Field($properties = array()) {
* @return string
*/
protected function getTabIndexHTML($increment = 0) {
// we can't add a tabindex if there hasn't been one set yet.
if($this->getAttribute('tabindex') === null) return false;

$tabIndex = (int)$this->getAttribute('tabindex') + (int)$increment;
return (is_numeric($tabIndex)) ? ' tabindex = "' . $tabIndex . '"' : '';
}
Expand Down

0 comments on commit c453ea3

Please sign in to comment.