Skip to content

Commit

Permalink
Fix issue with Tab+alt not being considered as isGlobalFocusVisible c…
Browse files Browse the repository at this point in the history
…andidate on Mac
  • Loading branch information
Andarist committed May 19, 2019
1 parent 31487dd commit 5781918
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/react-events/src/Focus.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ type FocusEvent = {|
timeStamp: number,
|};

const isMac = /^Mac/.test(navigator.platform);

const targetEventTypes = [
{name: 'focus', passive: true},
{name: 'blur', passive: true},
Expand Down Expand Up @@ -304,7 +306,7 @@ const FocusResponder = {
const nativeEvent = event.nativeEvent;
if (
nativeEvent.key === 'Tab' &&
!(nativeEvent.metaKey || nativeEvent.altKey || nativeEvent.ctrlKey)
!(nativeEvent.metaKey || (!isMac && nativeEvent.altKey) || nativeEvent.ctrlKey)
) {
state.pointerType = 'keyboard';
isGlobalFocusVisible = true;
Expand Down

0 comments on commit 5781918

Please sign in to comment.