mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-07 10:11:17 +02:00
Merge pull request #4565 from tractorcow/pulls/3.2/fix-numeric
BUG Remove html5 number field due to insufficient localisation support
This commit is contained in:
commit
d66dd05458
@ -82,13 +82,6 @@ class NumericField extends TextField {
|
|||||||
return 'numeric text';
|
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
|
* Validate this field
|
||||||
*
|
*
|
||||||
|
@ -187,8 +187,10 @@ class NumericFieldTest extends SapphireTest {
|
|||||||
$field = new NumericField('Number');
|
$field = new NumericField('Number');
|
||||||
|
|
||||||
$html = $field->Field();
|
$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