Skip to content

Commit

Permalink
React Events: support legacy browser Spacebar key value (facebook#15766)
Browse files Browse the repository at this point in the history
  • Loading branch information
necolas authored May 29, 2019
1 parent 9aad17d commit 2670bc3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/react-events/src/Press.js
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,8 @@ function dispatchCancel(

function isValidKeyPress(key: string): boolean {
// Accessibility for keyboards. Space and Enter only.
return key === ' ' || key === 'Enter';
// "Spacebar" is for IE 11
return key === 'Enter' || key === ' ' || key === 'Spacebar';
}

function calculateDelayMS(delay: ?number, min = 0, fallback = 0) {
Expand Down

0 comments on commit 2670bc3

Please sign in to comment.