From e86b45bf5db663b03e006a132e04afba37ee4bf3 Mon Sep 17 00:00:00 2001 From: Damian Mooyman Date: Tue, 1 Sep 2015 11:05:58 +1200 Subject: [PATCH] BUG Remove html5 number field due to insufficient localisation support --- forms/NumericField.php | 7 ------- tests/forms/NumericFieldTest.php | 6 ++++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/forms/NumericField.php b/forms/NumericField.php index 177cc1f64..6a40c2778 100644 --- a/forms/NumericField.php +++ b/forms/NumericField.php @@ -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 * diff --git a/tests/forms/NumericFieldTest.php b/tests/forms/NumericFieldTest.php index 5e82cd7f2..7e1a3788f 100644 --- a/tests/forms/NumericFieldTest.php +++ b/tests/forms/NumericFieldTest.php @@ -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'); } }