Skip to content

Commit

Permalink
Components: Prevent scroll on dropdown arrow press
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Mar 16, 2018
1 parent 6500179 commit 1902a65
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions components/dropdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,14 @@ class Dropdown extends Component {
this.toggle( true, true );
}

// Consider this key handled, since otherwise the behavior of other
// handlers may conflict with intended focus.
event.stopPropagation();

// Prevent scroll on arrow press.
if ( event.keyCode === DOWN ) {
event.preventDefault();
}
}

render() {
Expand Down

0 comments on commit 1902a65

Please sign in to comment.