Skip to content

Commit

Permalink
du kan nå bruke space eller enter for å rulle accordion item som du k…
Browse files Browse the repository at this point in the history
…unne før når det var button
  • Loading branch information
Ole Espen Lundsør committed Nov 29, 2017
1 parent cde9b4e commit 644b348
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/accordion-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ class AccordionItem extends Component {
onClick={ this.onClick }
onKeyUp={event => {
const enterKey = 13;
if (event.keyCode === enterKey) {
const spaceBar = 32;
if (event.keyCode === enterKey || event.keyCode === spaceBar) {
this.onClick(event);
}
}}
Expand Down

0 comments on commit 644b348

Please sign in to comment.