From: umherirrender Date: Mon, 30 Nov 2015 18:44:26 +0000 (+0100) Subject: Do not set autofocus for valid target input on Special:UserRights X-Git-Tag: 1.31.0-rc.0~8853^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/journal.php?a=commitdiff_plain;h=debacfbb37f08aed56f42ca3c73e70c328209d05;p=lhc%2Fweb%2Fwiklou.git Do not set autofocus for valid target input on Special:UserRights When open Special:UserRights with a valid user as target, there is no need to set the autofocus on the input field. Just set it on blank input and error input (such as non existing user or ip). Change-Id: I14b005b83adbbd899d2846c8d71cbfb1a1a25ad7 --- diff --git a/includes/specials/SpecialUserrights.php b/includes/specials/SpecialUserrights.php index a6fe1b5a12..1327972e66 100644 --- a/includes/specials/SpecialUserrights.php +++ b/includes/specials/SpecialUserrights.php @@ -458,8 +458,10 @@ class UserrightsPage extends SpecialPage { 30, str_replace( '_', ' ', $this->mTarget ), array( - 'autofocus' => '', 'class' => 'mw-autocomplete-user', // used by mediawiki.userSuggest + ) + ( + // Set autofocus on blank input and error input + $this->mFetchedUser === null ? array( 'autofocus' => '' ) : array() ) ) . ' ' . Xml::submitButton( $this->msg( 'editusergroup' )->text() ) .