diff --git a/Changes b/Changes index 27015789..82e271c3 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,8 @@ Revision history for WWW::Mechanize {{$NEXT}} + [FIXED] + - Fix click_button non exclusive attributes (GH#371) (Andreas Huber) [TESTS] - Remove t/untaint.t (GH#377) (Olaf Alders) diff --git a/lib/WWW/Mechanize.pm b/lib/WWW/Mechanize.pm index a5fb033f..6939f9e2 100644 --- a/lib/WWW/Mechanize.pm +++ b/lib/WWW/Mechanize.pm @@ -2538,7 +2538,8 @@ sub click_button { value => 1, ); - my @present_exclusive_options = @exclusive_options{ keys %args }; + my @present_exclusive_options + = map { $_ || () } @exclusive_options{ keys %args }; if ( scalar @present_exclusive_options > 1 ) { $self->die( diff --git a/t/local/click_button.t b/t/local/click_button.t index 510a9bff..71d9c20f 100644 --- a/t/local/click_button.t +++ b/t/local/click_button.t @@ -113,6 +113,11 @@ subtest 'multiple button selectors' => sub { 'Dies when multiple button selectors are used'; }; +subtest 'click with coordinates' => sub { + $mech->click_button( name => 'button_tag', x => 10, y => 5 ); + test_click( $mech, 'button_tag', 'Walk' ); +}; + sub test_click { my $mech = shift; my $name = shift || 'submit';