can-attribute-observable
Advanced tools
Comparing version 1.2.3 to 1.2.4
@@ -151,2 +151,18 @@ var testHelpers = require("../test/helpers"); | ||
}); | ||
testIfRealDocument("setting .value on a textarea to undefined or null makes value empty string (28)", function(assert){ | ||
var textarea = document.createElement("textarea"); | ||
var ta = this.fixture; | ||
ta.appendChild(textarea); | ||
var obs = new AttributeObservable(textarea, "value"); | ||
obs.set('something'); | ||
assert.equal(obs.get(), "something", "correct string value"); | ||
obs.set(null); | ||
assert.equal(obs.get(), "", "null handled correctly"); | ||
obs.set(undefined); | ||
assert.equal(obs.get(), "", "undefined handled correctly"); | ||
}); | ||
}); |
@@ -353,3 +353,3 @@ 'use strict'; | ||
var nodeName = this.nodeName.toLowerCase(); | ||
if(nodeName === "input") { | ||
if(nodeName === "input" || nodeName === "textarea") { | ||
// Do some input types support non string values? | ||
@@ -356,0 +356,0 @@ value = toString(value); |
{ | ||
"name": "can-attribute-observable", | ||
"version": "1.2.3", | ||
"version": "1.2.4", | ||
"description": "Create observables from HTML attributes.", | ||
@@ -5,0 +5,0 @@ "main": "can-attribute-observable", |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
48281
1127
0