mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUG Fixing tabindex added to CreditCardField when tabindex is NULL
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.
This commit is contained in:
parent
a7f38f7b4d
commit
c453ea3094
@ -35,6 +35,9 @@ class CreditCardField extends TextField {
|
|||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
protected function getTabIndexHTML($increment = 0) {
|
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;
|
$tabIndex = (int)$this->getAttribute('tabindex') + (int)$increment;
|
||||||
return (is_numeric($tabIndex)) ? ' tabindex = "' . $tabIndex . '"' : '';
|
return (is_numeric($tabIndex)) ? ' tabindex = "' . $tabIndex . '"' : '';
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user