Skip to content

Commit

Permalink
change handleKeyDown key in Modal TopBar
Browse files Browse the repository at this point in the history
  • Loading branch information
thayannevls authored and emersonlaurentino committed Mar 18, 2020
1 parent 35bf29f commit bf6712e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions react/components/Modal/TopBar.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ const TopBar = props => {
showCloseIcon,
} = props

const handleKeyDown = event => {
if (event.key === 'Escape' || event.key === 'Esc') {
const handleKeyDown = ({ key }) => {
const SPACE = ' '
const ENTER = 'Enter'

if (key === SPACE || key === ENTER) {
onClose()
}
}
Expand Down

0 comments on commit bf6712e

Please sign in to comment.