Open tnunamak opened 10 years ago
When a new list item is added, it's assigned a value of null.
null
this.addItem(null, true);
https://github.com/powmedia/backbone-forms/blob/master/src/editors/extra/list.js#L17
Because the editor initialization only checks for undefined, the value doesn't get overridden with the defaultValue for that item type:
undefined
defaultValue
if (this.value === undefined) this.value = this.defaultValue;
https://github.com/powmedia/backbone-forms/blob/master/src/editor.js#L34
Is there a particular rationale for initializing list items with null values? If not, may I suggest calling addItem with undefined?
addItem
Ignore that first pull request.
When a new list item is added, it's assigned a value of
null
.https://github.com/powmedia/backbone-forms/blob/master/src/editors/extra/list.js#L17
Because the editor initialization only checks for
undefined
, the value doesn't get overridden with thedefaultValue
for that item type:https://github.com/powmedia/backbone-forms/blob/master/src/editor.js#L34
Is there a particular rationale for initializing list items with
null
values? If not, may I suggest callingaddItem
withundefined
?