Fix autofocus on Special:Activeusers
authorumherirrender <umherirrender_de.wp@web.de>
Wed, 24 Feb 2016 19:40:53 +0000 (20:40 +0100)
committerumherirrender <umherirrender_de.wp@web.de>
Wed, 24 Feb 2016 19:40:53 +0000 (20:40 +0100)
Xml::inputLabel does not know about boolean parameters like autofocus,
so add it with an empty value or omitted it.

Fix validation error:
Bad value 1 for attribute autofocus on element input.

Change-Id: Idb7a7b58079d6c44b5a7f1fa226218bb685c8241

includes/specials/SpecialActiveusers.php

index c06db01..9c5fc2f 100644 (file)
@@ -223,8 +223,10 @@ class ActiveUsersPager extends UsersPager {
                        [
                                'class' => 'mw-ui-input-inline mw-autocomplete-user',
                                'tabindex' => 1,
-                               'autofocus' => $this->requestedUser === '',
-                       ]
+                       ] + (
+                               // Set autofocus on blank input
+                               $this->requestedUser === '' ? [ 'autofocus' => '' ] : []
+                       )
                ) . '<br />';
 
                $out .= Xml::checkLabel( $this->msg( 'activeusers-hidebots' )->text(),