BUG Remove html5 number field due to insufficient localisation support

This commit is contained in:
Damian Mooyman 2015-09-01 11:05:58 +12:00
parent 3f181d1ce1
commit e86b45bf5d
2 changed files with 4 additions and 9 deletions

View File

@ -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
*

View File

@ -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');
}
}