Skip to content

Commit a0b8e17

Browse files
committed
tighter scope for changes to hover label logic
keep the original isValidTextValue except in templating
1 parent 94f76cb commit a0b8e17

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ lib.templateString = function(string, obj) {
10691069
getterCache[key] = getterCache[key] || lib.nestedProperty(obj, key).get;
10701070
v = getterCache[key](true); // true means don't replace undefined with null
10711071
}
1072-
return lib.isValidTextValue(v) ? v : '';
1072+
return (v !== undefined) ? v : '';
10731073
});
10741074
};
10751075

@@ -1306,9 +1306,9 @@ lib.fillText = function(calcPt, trace, contOut) {
13061306
if(lib.isValidTextValue(tx)) return fill(tx);
13071307
};
13081308

1309-
// accept anything but undefined - was all truthy values and 0 (which gets cast to '0' in the hover labels)
1309+
// accept all truthy values and 0 (which gets cast to '0' in the hover labels)
13101310
lib.isValidTextValue = function(v) {
1311-
return v !== undefined;
1311+
return v || v === 0;
13121312
};
13131313

13141314
/**

0 commit comments

Comments
 (0)