(bug 43560) Initial input focus on Special:ListUsers isn't set
authorMarius Hoch <hoo@online.de>
Tue, 1 Jan 2013 21:44:53 +0000 (22:44 +0100)
committerMarius Hoch <hoo@online.de>
Thu, 31 Jan 2013 23:15:18 +0000 (00:15 +0100)
Set the input focus on Special:ListUsers to the user name field
in case no user name was given as input.

Change-Id: I13b75baf95bac8d25b019a82e9f8504cfa779b96

includes/specials/SpecialListusers.php

index ea598c3..5787595 100644 (file)
@@ -218,7 +218,16 @@ class UsersPager extends AlphabeticPager {
 
                # Username field
                $out .= Xml::label( $this->msg( 'listusersfrom' )->text(), 'offset' ) . ' ' .
-                       Xml::input( 'username', 20, $this->requestedUser, array( 'id' => 'offset' ) ) . ' ';
+                       Html::input(
+                               'username',
+                               $this->requestedUser,
+                               'text',
+                               array(
+                                       'id' => 'offset',
+                                       'size' => 20,
+                                       'autofocus' => $this->requestedUser === ''
+                               )
+                       ) . ' ';
 
                # Group drop-down list
                $out .= Xml::label( $this->msg( 'group' )->text(), 'group' ) . ' ' .