dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Fix typo in apierror message"
[lhc/web/wiklou.git]
/
includes
/
htmlform
/
fields
/
HTMLTextField.php
diff --git
a/includes/htmlform/fields/HTMLTextField.php
b/includes/htmlform/fields/HTMLTextField.php
index
b51182a
..
60c63d6
100644
(file)
--- a/
includes/htmlform/fields/HTMLTextField.php
+++ b/
includes/htmlform/fields/HTMLTextField.php
@@
-85,18
+85,19
@@
class HTMLTextField extends HTMLFormField {
'type',
'min',
'max',
'type',
'min',
'max',
- 'pattern',
- 'title',
'step',
'step',
- '
list
',
+ '
title
',
'maxlength',
'tabindex',
'disabled',
'required',
'autofocus',
'maxlength',
'tabindex',
'disabled',
'required',
'autofocus',
- 'multiple',
'readonly',
'autocomplete',
'readonly',
'autocomplete',
+ // Only used in HTML mode:
+ 'pattern',
+ 'list',
+ 'multiple',
];
$attribs += $this->getAttributes( $allowedParams );
];
$attribs += $this->getAttributes( $allowedParams );
@@
-117,6
+118,7
@@
class HTMLTextField extends HTMLFormField {
switch ( $this->mParams['type'] ) {
case 'int':
$type = 'number';
switch ( $this->mParams['type'] ) {
case 'int':
$type = 'number';
+ $attribs['step'] = 1;
break;
case 'float':
$type = 'number';
break;
case 'float':
$type = 'number';
@@
-152,17
+154,22
@@
class HTMLTextField extends HTMLFormField {
# @todo Enforce pattern, step, required, readonly on the server side as
# well
$allowedParams = [
# @todo Enforce pattern, step, required, readonly on the server side as
# well
$allowedParams = [
+ 'type',
+ 'min',
+ 'max',
+ 'step',
+ 'title',
+ 'maxlength',
+ 'tabindex',
+ 'disabled',
+ 'required',
'autofocus',
'autofocus',
+ 'readonly',
+ 'autocomplete',
+ // Only used in OOUI mode:
'autosize',
'autosize',
- 'disabled',
'flags',
'indicator',
'flags',
'indicator',
- 'maxlength',
- 'readonly',
- 'required',
- 'tabindex',
- 'type',
- 'autocomplete',
];
$attribs += OOUI\Element::configFromHtmlAttributes(
];
$attribs += OOUI\Element::configFromHtmlAttributes(
@@
-181,6
+188,9
@@
class HTMLTextField extends HTMLFormField {
}
$type = $this->getType( $attribs );
}
$type = $this->getType( $attribs );
+ if ( isset( $attribs['step'] ) && $attribs['step'] === 'any' ) {
+ $attribs['step'] = null;
+ }
return $this->getInputWidget( [
'id' => $this->mID,
return $this->getInputWidget( [
'id' => $this->mID,