Skip to content

Commit

Permalink
Rollup merge of #79985 - GuillaumeGomez:fix-submit-event, r=jyn514
Browse files Browse the repository at this point in the history
Fixes submit event of the search input

Fixes #79960

It's a very funny corner case:

In HTML, when a button follows an input (in a `form`), if the enter keep is pressed on the input, instead of sending the submit event to the input, it'll create a click event on the button following it, which in this case made the help popup show up whenever "enter" was pressed.

cc `@camelid`

r? `@jyn514`
  • Loading branch information
JohnTitor authored Dec 13, 2020
2 parents 424e44a + 98118bb commit 3213089
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/librustdoc/html/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ crate fn render<T: Print, S: Print>(
placeholder=\"Click or press ‘S’ to search, ‘?’ for more options…\" \
type=\"search\">\
</div>\
<button class=\"help-button\">?</button>
<button type=\"button\" class=\"help-button\">?</button>
<a id=\"settings-menu\" href=\"{root_path}settings.html\">\
<img src=\"{static_root_path}wheel{suffix}.svg\" \
width=\"18\" \
Expand Down

0 comments on commit 3213089

Please sign in to comment.