* @return array Attributes
*/
public function getAttributes( array $list, array $mappings = null ) {
- static $boolAttribs = array( 'disabled', 'required', 'multiple', 'readonly' );
+ static $boolAttribs = array( 'disabled', 'required', 'autofocus', 'multiple', 'readonly' );
$ret = array();
foreach ( $list as $key ) {
if ( in_array( $key, $boolAttribs ) ) {
if ( !empty( $this->mParams[$key] ) ) {
- $ret[$mappedKey] = '';
+ $ret[$mappedKey] = $mappedKey;
}
} elseif ( isset( $this->mParams[$key] ) ) {
$ret[$mappedKey] = $this->mParams[$key];
'readonly' => 'readOnly',
) );
- if ( isset( $attribs['readOnly'] ) ) {
- // this needs to be set to a boolean value - hack??
- $attribs['readOnly'] = true;
- }
-
return new OOUI\TextInputWidget( array(
'id' => $this->mID,
'name' => $this->mName,
'tabindex' => 'tabIndex',
) );
- if ( isset( $attribs['readOnly'] ) ) {
- // This needs to be set to a boolean value
- $attribs['readOnly'] = true;
- }
-
$type = $this->getType( $attribs );
return $this->getInputWidget( array(