Skip to content

Commit

Permalink
fix(gatsbygram): spacebar is not the right key to adress the spaceb…
Browse files Browse the repository at this point in the history
…ar (#12381)

From the API documentation https://craig.is/killing/mice/#keys you will see, the right key is `space`.
  • Loading branch information
nextlevelshit authored and pieh committed Mar 7, 2019
1 parent 9b11381 commit 48cc78b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/gatsbygram/src/components/modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ class GatsbyGramModal extends React.Component {
componentDidMount() {
mousetrap.bind(`left`, () => this.previous())
mousetrap.bind(`right`, () => this.next())
mousetrap.bind(`spacebar`, () => this.next())
mousetrap.bind(`space`, () => this.next())
}

componentWillUnmount() {
mousetrap.unbind(`left`)
mousetrap.unbind(`right`)
mousetrap.unbind(`spacebar`)
mousetrap.unbind(`space`)
}

findCurrentIndex() {
Expand Down

0 comments on commit 48cc78b

Please sign in to comment.