Add test for range step size for int (1) vs float (0.1) (#1776)

* Add test for range step size for int (1) vs float (0.1)

* Remove old default setting for integer

* fixed tests
This commit is contained in:
Jeffrey Warren
2020-12-05 12:34:49 -05:00
committed by GitHub
parent cbaa0f0f6f
commit 5a6d5560ff
3 changed files with 8 additions and 4 deletions

View File

@@ -7,6 +7,7 @@ function mapHtmlTypes(inputInfo){
switch(inputInfo.type.toLowerCase()){
case 'integer':
htmlType = inputInfo.min != undefined ? 'range' : 'number';
if (htmlType === 'range') inputInfo.step = inputInfo.step || 1; // default range step size for integer
break;
case 'string':
htmlType = 'text';
@@ -19,6 +20,7 @@ function mapHtmlTypes(inputInfo){
break;
case 'float':
htmlType = inputInfo.min != undefined ? 'range' : 'text';
if (htmlType === 'range') inputInfo.step = inputInfo.step || 0.1; // default range step size for float
break;
default:
htmlType = 'text';