mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUG Remove html5 number field due to insufficient localisation support
This commit is contained in:
parent
3f181d1ce1
commit
e86b45bf5d
@ -82,13 +82,6 @@ class NumericField extends TextField {
|
||||
return 'numeric text';
|
||||
}
|
||||
|
||||
public function getAttributes() {
|
||||
return array_merge(parent::getAttributes(), array(
|
||||
'type' => 'number',
|
||||
'step' => 'any' // allows entering float/decimal numbers like "1.2" instead of just integers
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Validate this field
|
||||
*
|
||||
|
@ -187,8 +187,10 @@ class NumericFieldTest extends SapphireTest {
|
||||
$field = new NumericField('Number');
|
||||
|
||||
$html = $field->Field();
|
||||
$this->assertContains('type="number"', $html, 'number type set');
|
||||
$this->assertContains('step="any"', $html, 'step value set to any');
|
||||
|
||||
// @todo - Revert to number one day when html5 number supports proper localisation
|
||||
// See https://github.com/silverstripe/silverstripe-framework/pull/4565
|
||||
$this->assertContains('type="text"', $html, 'number type not set');
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user