mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-27 03:57:21 +00:00
Fix problem with checkbox widget and empty strings
If the value of `tiddler.fields[this.checkboxField]` was an empty string then it would incorrectly fall back to the value of `this.checkboxDefault`.
This commit is contained in:
parent
9418538104
commit
1a2ec12831
@ -65,7 +65,12 @@ CheckboxWidget.prototype.getValue = function() {
|
||||
}
|
||||
}
|
||||
if(this.checkboxField) {
|
||||
var value = tiddler.fields[this.checkboxField] || this.checkboxDefault || "";
|
||||
var value;
|
||||
if($tw.utils.hop(tiddler.fields,this.checkboxField)) {
|
||||
value = tiddler.fields[this.checkboxField] || "";
|
||||
} else {
|
||||
value = this.checkboxDefault || "";
|
||||
}
|
||||
if(value === this.checkboxChecked) {
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user