Skip to content

Commit fa3406a

Browse files
authored
pebble#151 - Fix incorrect value being set when defaultValue is falsey (pebble#152)
1 parent 46c0adb commit fa3406a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

dev/config.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ module.exports = [
6464
{
6565
"type": "slider",
6666
"messageKey": "slider",
67-
"defaultValue": 15,
67+
"defaultValue": 0,
6868
"label": "Slider",
6969
"description": "This is the description for the slider",
70-
"min": 10,
71-
"max": 20,
70+
"min": 0,
71+
"max": 30,
7272
"step": 0.25
7373
},
7474
{

src/scripts/lib/clay-config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,9 @@ function ClayConfig(settings, config, $rootContainer, meta) {
8686
// set the value of the item via the manipulator to ensure consistency
8787
var value = typeof _settings[_item.messageKey] !== 'undefined' ?
8888
_settings[_item.messageKey] :
89-
(_item.defaultValue || '');
89+
_item.defaultValue;
9090

91-
clayItem.set(value);
91+
clayItem.set(typeof value !== 'undefined' ? value : '');
9292

9393
$container.add(clayItem.$element);
9494
}

0 commit comments

Comments
 (0)