Support maxlength
This commit is contained in:
parent
c621e651c9
commit
983b556fa8
|
@ -101,7 +101,8 @@ Capybara = {
|
|||
if (type == "text" || type == "textarea" || type == "password") {
|
||||
this.trigger(index, "focus");
|
||||
node.value = "";
|
||||
for(var strindex = 0; strindex < value.length; strindex++) {
|
||||
var length = this.attribute(index, "maxlength") || value.length;
|
||||
for(var strindex = 0; strindex < length; strindex++) {
|
||||
node.value += value[strindex];
|
||||
this.trigger(index, "keydown");
|
||||
this.keypress(index, false, false, false, false, 0, value[strindex]);
|
||||
|
|
Loading…
Reference in New Issue