Skip to content

Commit

Permalink
add maxlength test
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickkettner committed Dec 10, 2013
1 parent 31d16c2 commit 64bc5d8
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
22 changes: 22 additions & 0 deletions feature-detects/textarea/maxlength.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*!
{
"name": "textarea maxlength",
"property": "textareamaxlength",
"aliases": ["textarea-maxlength"],
"notes": [{
"name": "MDN documentation",
"href": "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/textarea"
}],
"polyfills": [
"maxlength"
]
}
!*/
/* DOC
Detect support for the maxlength attribute of a textarea element
*/
define(['Modernizr', 'createElement'], function( Modernizr, createElement ) {
Modernizr.addTest('textareamaxlength', !!('maxLength' in createElement('textarea')));
});
1 change: 1 addition & 0 deletions lib/config-all.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@
"test/svg/inline",
"test/svg/smil",
"test/svg",
"test/textarea/maxlength",
"test/touchevents",
"test/typed-arrays",
"test/unicode",
Expand Down
7 changes: 6 additions & 1 deletion lib/polyfills.json
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,11 @@
"name": "JavaScript Flash VM",
"authors": ["Mozilla Foundation"],
"href": "https://github.com/mozilla/shumway",
"licenses": ["Apache2"]
"licenses": ["Apache2"],
"maxlength": {
"name": "maxlength plugin",
"authors": ["Remy Sharp"],
"href": "http://remysharp.com/2008/06/30/maxlength-plugin/",
"licenses": ["CC SA"]
}
}

0 comments on commit 64bc5d8

Please sign in to comment.