diff --git a/src/htmx.js b/src/htmx.js index 55b1b93f..ec7e07e7 100644 --- a/src/htmx.js +++ b/src/htmx.js @@ -2142,7 +2142,7 @@ return (function () { // and the new value could be arrays, so we have to handle all four cases :/ if (name != null && value != null) { var current = values[name]; - if(current) { + if (current !== undefined) { if (Array.isArray(current)) { if (Array.isArray(value)) { values[name] = current.concat(value); diff --git a/test/core/parameters.js b/test/core/parameters.js index 08d79e99..0524a31b 100644 --- a/test/core/parameters.js +++ b/test/core/parameters.js @@ -78,6 +78,12 @@ describe("Core htmx Parameter Handling", function() { vals['do'].should.deep.equal(['rey1', 'rey2']); }) + it('Double empty values are included as array in correct order', function () { + var form = make('
'); + var vals = htmx._('getInputValues')(byId("i3")).values; + vals['do'].should.deep.equal(['', 'rey', '']); + }) + it('hx-include works with form', function () { var form = make('
'); var div = make('
');