'type',
'min',
'max',
- 'pattern',
- 'title',
'step',
- 'list',
+ 'title',
'maxlength',
'tabindex',
'disabled',
'required',
'autofocus',
- 'multiple',
'readonly',
'autocomplete',
+ // Only used in HTML mode:
+ 'pattern',
+ 'list',
+ 'multiple',
];
$attribs += $this->getAttributes( $allowedParams );
switch ( $this->mParams['type'] ) {
case 'int':
$type = 'number';
+ $attribs['step'] = 1;
break;
case 'float':
$type = 'number';
case 'url':
$type = $this->mParams['type'];
break;
+ case 'textwithbutton':
+ $type = $this->mParams['inputtype'] ?? 'text';
+ break;
}
}
# @todo Enforce pattern, step, required, readonly on the server side as
# well
$allowedParams = [
+ 'type',
+ 'min',
+ 'max',
+ 'step',
+ 'title',
+ 'maxlength',
+ 'tabindex',
+ 'disabled',
+ 'required',
'autofocus',
+ 'readonly',
+ 'autocomplete',
+ // Only used in OOUI mode:
'autosize',
- 'disabled',
'flags',
'indicator',
- 'maxlength',
- 'readonly',
- 'required',
- 'tabindex',
- 'type',
- 'autocomplete',
];
$attribs += OOUI\Element::configFromHtmlAttributes(
}
$type = $this->getType( $attribs );
+ if ( isset( $attribs['step'] ) && $attribs['step'] === 'any' ) {
+ $attribs['step'] = null;
+ }
return $this->getInputWidget( [
'id' => $this->mID,