The other field is in most case the default item selected in the drop
down box when a page is loaded. But when the last item is selected you
have to scroll to the top to select one of the first item, which are
often the common or most used items.
So adding the 'other' always as first item to the list.
For the HTMLSelectAndOtherField this was before
If4175332405d26c7ff2e8fbe100bcad61762ce6f, so that is fixing a
regression. In my opinion it should be the same for both types.
Follow-Up: If4175332405d26c7ff2e8fbe100bcad61762ce6f
Change-Id: I82f31e260d63bfaa6a4a94908e019feb9e0f2421
throw new MWException( 'HTMLSelectAndOtherField called without any options' );
}
if ( !in_array( 'other', $this->mOptions, true ) ) {
- $this->mOptions[$params['other']] = 'other';
+ // Have 'other' always as first element
+ $this->mOptions = array( $params['other'] => 'other' ) + $this->mOptions;
}
$this->mFlatOptions = self::flattenOptions( $this->getOptions() );
isset( $params['other'] )
? $params['other']
: wfMessage( 'htmlform-selectorother-other' )->text();
- $this->mOptions[$msg] = 'other';
+ // Have 'other' always as first element
+ $this->mOptions = array( $msg => 'other' ) + $this->mOptions;
}
}