Skip to content

Commit

Permalink
Revert "Fix an issue with val() returning invalid values on Chrome fo…
Browse files Browse the repository at this point in the history
…r Android, fixes #870."

This reverts commit 9cf3adf.
  • Loading branch information
madrobby committed Dec 1, 2013
1 parent 9cf3adf commit bbc6bb8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/zepto.js
Expand Up @@ -627,7 +627,7 @@ var Zepto = (function() {
val: function(value){
return arguments.length === 0 ?
(this[0] && (this[0].multiple ?
$(this[0]).find('option[selected]').pluck('value') :
$(this[0]).find('option').filter(function(o){ return this.selected }).pluck('value') :
this[0].value)
) :
this.each(function(idx){
Expand Down
2 changes: 1 addition & 1 deletion test/zepto.html
Expand Up @@ -1844,7 +1844,7 @@ <h1>Zepto DOM unit tests</h1>
$('<select multiple><option selected>1</option><option value=2 selected="selected">a</option><option>3</option></select>')
t.assertEqualCollection(['1','2'], multiple.val())

$(multiple.find('option').get(0)).removeAttr('selected')
multiple.find('option')[0].selected = false
t.assertEqualCollection(['2'], multiple.val())
},

Expand Down

0 comments on commit bbc6bb8

Please sign in to comment.