-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #163 from tmpduarte/fix-serialization
Fixes issue #162 - iron-form element does not serialise all duplicates if the first one has value equal to empty string
- Loading branch information
Showing
2 changed files
with
8 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -292,7 +292,7 @@ | |
function addSerializedElement(name, value) { | ||
// If the name doesn't exist, add it. Otherwise, serialize it to | ||
// an array, | ||
if (!json[name]) { | ||
if (json[name] === undefined) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
notwaldorf
Author
Contributor
|
||
json[name] = value; | ||
} else { | ||
if (!Array.isArray(json[name])) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
probably should've been
if (typeof json[name] === "undefined") ...
as undefined is just a symbol that can be overwritten.