Comparing version 1.4.0 to 1.4.1
@@ -33,3 +33,3 @@ var bel = require('bel') // turns template tag into DOM elements | ||
if ((f.nodeName === 'INPUT' && f.type !== 'file') || f.nodeName === 'SELECT') { | ||
if (!newValue) { | ||
if (!newValue && !t.hasAttribute('value')) { | ||
t.value = f.value | ||
@@ -36,0 +36,0 @@ } else if (newValue !== oldValue) { |
{ | ||
"name": "yo-yo", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "A tiny library for building modular UI components using DOM diffing and ES6 tagged template literals", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -59,2 +59,11 @@ /*global Event*/ | ||
test('input value can be update to empty string', function (t) { | ||
t.plan(1) | ||
var el = yo`<input type="text"/>` | ||
el.value = 'hola' | ||
var newEl = yo`<input type="text" value=""/>` | ||
yo.update(el, newEl) | ||
t.equal(el.value, '') | ||
}) | ||
test('textarea values get copied', function (t) { | ||
@@ -61,0 +70,0 @@ t.plan(1) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45805
164