mirror of
https://github.com/Hopiu/jquery-mobile.git
synced 2026-03-16 22:10:25 +00:00
test that autogrow is triggered on keyup
This commit is contained in:
parent
5150114c13
commit
845f657ddf
2 changed files with 18 additions and 0 deletions
|
|
@ -43,6 +43,9 @@
|
|||
Place holder text
|
||||
Place holder text
|
||||
</textarea>
|
||||
|
||||
<textarea id="keyup-autogrow">
|
||||
</textarea>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -24,4 +24,19 @@
|
|||
start();
|
||||
}, 400);
|
||||
});
|
||||
|
||||
asyncTest( "textarea should autogrow when text is added via the keyboard", function() {
|
||||
var test = $( "#keyup-autogrow" ),
|
||||
originalHeight = test[0].clientHeight;
|
||||
|
||||
test.keyup(function() {
|
||||
setTimeout(function() {
|
||||
ok( test[0].clientHeight > originalHeight, "the height is greater than original with no content" );
|
||||
ok( test[0].clientHeight > 100, "autogrow text area's height is greater any style/padding");
|
||||
start();
|
||||
}, 400)
|
||||
});
|
||||
|
||||
test.val("foo\n\n\n\n\n\n\n\n\n\n\n\n\n\n").trigger("keyup");
|
||||
});
|
||||
})(jQuery);
|
||||
Loading…
Reference in a new issue