Skip to content

Commit

Permalink
Setting maxLength to undefined yields weird result on Phantom
Browse files Browse the repository at this point in the history
Apparently it sets maxLength to "524288":
https://travis-ci.org/madrobby/zepto/builds/29254260

Use a custom property to avoid magic browser behavior around certain
properties.
  • Loading branch information
mislav committed Jul 6, 2014
1 parent 2414598 commit 04f1490
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/zepto.html
Original file line number Diff line number Diff line change
Expand Up @@ -1742,14 +1742,14 @@ <h1>Zepto Core unit tests</h1>
},

testPropSetterErase: function(t){
var input = $('<input readonly maxlength=5>')
var input = $('<input readonly>')
t.assertIdentical(input, input.prop('readonly', false))
t.assertFalse(input.prop('readonly'))

t.assertIdentical(5, input.get(0).maxLength)
t.assertIdentical(input, input.prop('maxlength', undefined))
t.assertIdentical(0, input.get(0).maxLength)
t.assertIdentical(0, input.prop('maxlength'))
input.get(0)._foo = 'bar'
t.assertIdentical(input, input.prop('_foo', undefined))
t.assertUndefined(input.get(0)._foo, 'custom property should be cleared')
t.assertUndefined(input.prop('_foo'), 'prop should reflect cleared property')
},

testAttrNoElement: function(t){
Expand Down

0 comments on commit 04f1490

Please sign in to comment.