Skip to content

Commit

Permalink
refactor(RenderLayer): wip
Browse files Browse the repository at this point in the history
  • Loading branch information
lossir committed Apr 19, 2021
1 parent d0196bd commit eec857d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/react-ui/internal/RenderLayer/RenderLayer.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import { findDOMNode } from 'react-dom';
import tabbable from 'tabbable';

import { listen as listenFocusOutside, containsTargetOrRenderContainer } from '../../lib/listenFocusOutside';
import { CommonProps, CommonWrapper } from '../CommonWrapper';
Expand Down Expand Up @@ -85,7 +86,7 @@ export class RenderLayer extends React.Component<RenderLayerProps> {
}

private handleFocusOutside = (event: Event) => {
if (this.props.onFocusOutside) {
if (this.props.onFocusOutside && event.target && tabbable.isFocusable(event.target as HTMLElement)) {
this.props.onFocusOutside(event);
}
};
Expand Down

0 comments on commit eec857d

Please sign in to comment.