#151 - Fix incorrect value being set when defaultValue is falsey (#152)

This commit is contained in:
Keegan Lillo
2016-10-21 12:11:12 -07:00
committed by GitHub
parent 46c0adb62c
commit fa3406a809
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -64,11 +64,11 @@ module.exports = [
{
"type": "slider",
"messageKey": "slider",
"defaultValue": 15,
"defaultValue": 0,
"label": "Slider",
"description": "This is the description for the slider",
"min": 10,
"max": 20,
"min": 0,
"max": 30,
"step": 0.25
},
{
+2 -2
View File
@@ -86,9 +86,9 @@ function ClayConfig(settings, config, $rootContainer, meta) {
// set the value of the item via the manipulator to ensure consistency
var value = typeof _settings[_item.messageKey] !== 'undefined' ?
_settings[_item.messageKey] :
(_item.defaultValue || '');
_item.defaultValue;
clayItem.set(value);
clayItem.set(typeof value !== 'undefined' ? value : '');
$container.add(clayItem.$element);
}