Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
there should be a multiple attribute
  • Loading branch information
kraih committed Sep 22, 2015
1 parent e985701 commit 8c4e78a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions lib/Mojo/DOM.pm
Expand Up @@ -163,8 +163,7 @@ sub val {
my $self = shift;

# "option"
my $tag = $self->tag;
return $self->{value} // $self->text if $tag eq 'option';
return $self->{value} // $self->text if (my $tag = $self->tag) eq 'option';

# "select"
return $self->find('option:checked')->map('val')->to_array
Expand Down
2 changes: 1 addition & 1 deletion t/mojo/dom.t
Expand Up @@ -2180,7 +2180,7 @@ $dom = Mojo::DOM->new(<<EOF);
<input type="text" name="a" value="A" />
<input type="checkbox" checked name="b" value="B">
<input type="radio" checked name="c" value="C">
<select name="f">
<select multiple name="f">
<option value="F">G</option>
<optgroup>
<option>H</option>
Expand Down

0 comments on commit 8c4e78a

Please sign in to comment.