Target field doesn't work in newbies mode so users doesn't need to enter in that field
newbies mode also. This is not a huge issue normally but annoying when you're on a tablet
or mobile where the autofocus makes the screen keyboard be shown when you visit the page.
Bug: T117397
Change-Id: Ic6fd2fb2421325f748fccb2a5432e7713d0dcbb0
'mw-ui-input-inline',
'mw-autocomplete-user', // used by mediawiki.userSuggest
),
- ) + ( $this->opts['target'] ? array() : array( 'autofocus' ) )
+ ) + (
+ // Only autofocus if target hasn't been specified or in non-newbies mode
+ ( $this->opts['contribs'] === 'newbie' || $this->opts['target'] )
+ ? array() : array( 'autofocus' => true )
+ )
);
+
$targetSelection = Html::rawElement(
'td',
array( 'colspan' => 2 ),